This is probably a simple problem to the scala educated mind but I'm still a beginner ;)
I have a base actor who dispatches a task to multiple worker actors and replies it's result to a blocking external call via !?
a = new a
a.start
println(a !? "12345")
class a extends Actor {
def act = {
loop {
react {
case msg =>
val result = worker_actor_1 !? msg
result += worker_actor_2 !? msg
result += worker_actor_3 !? msg
// So I just have multiple workers who should do stuff in parallel and the aggregated result should be returned to the calling function
reply(result)
}
Now I don't know how to truly parallelize the worker actors in the blocking call because in the end I have to reply(). The calling entitiy is no actor, just a regular class.