-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
зделяль #3
base: master
Are you sure you want to change the base?
зделяль #3
Conversation
case class FinishOrder(orderId: Int, customer: ActorRef[Customer.Eat.type]) extends Command | ||
case class FinishOrder(orderId: Int, customer: ActorRef[Customer.Eat.type]) extends Command | ||
|
||
val random: Random = new Random() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опять какой-то глобальный рандом, который шерится между всеми шефами. Можно хотя бы в Behaviors.setup его инициализирвоать
val random: Random = new Random() | ||
|
||
def apply(waiter: ActorRef[Waiter.Command], chefConfig: ChefConfig, seed: Long): Behavior[Command] = { | ||
random.setSeed(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В итоге у рандома будет сид последнего созданного шефа
customerConfig: CustomerConfig, | ||
seed: Long | ||
): Behavior[Command] = { | ||
val random: Random = new Random(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот здесь лучше чем в шефах
|
||
def apply(): Behavior[Command] = ??? | ||
// Based on the fact that there is only one waiter in the system. | ||
// And also on the fact that I can't no more with all this refactoring ;_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а ты через силу
} | ||
|
||
object ChefSpec { | ||
val config: ChefConfig = ChefConfig(Boundaries(1, 2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
иммутабельные вещи запихивать сюда нормально, но всякие инбоксы – нет, они очень мутабельные
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может показаться что в тестах можно говнокодить (и это правда), но конкретно здесь проблема в том, что тест-кейзы могут запускаться отдельно от других кейзов, и тогда будет проблема с консистентностью начального стейта
xxsdfgdsa
No description provided.