I have an actor who creates another one:
class MyActor1 extends Actor {
val a2 = system actorOf Props(new MyActor(123))
}
The second actor should initialize (bootstrap) itself after its creation, and only after that it should be able to perform another task.
class MyActor2(a: Int) extends Actor {
val initValue =
def receive = {
case "job1" =>
}
}
So, the very first thing to do MyActor2is do some initialization work. This may take some time as it requests the server. Only after successful completion should it be able to process incoming messages through receive. Before that - he should not do this.
, (, Future, async, await , AsyncHttpClient). , , .
?
p.s. , .