These are chat archives for petabridge/akka-bootcamp

Jan 2017
Jan 10 2017 14:25
Sorry been offline.
@Aaronontheweb. Got that.
@Aaronontheweb. How do i return a response to an action in an mvc controller from an actor .
@Aaronontheweb . Thsis the scenarioo.
@Aaronontheweb. An mvc action calls actor 1 by sending actorRef.ask<msg>, actor 1 recieves the message, then calls actor 2 using tell, actor 2 processes, then send a response to back to actor 1 using tell. Now if actor 1 wants to respond back to the mvc action, if i use sender.tell(msg), the response will go back to actor 2 because at that point actor 2 is the sender. So my question, from this scenario, how will it respond back to mvc action?
Jan 10 2017 14:31
@Aaronontheweb I have implemented behaviour perfectly. Thanks
Jan 10 2017 17:33
@Aaronontheweb . Got it to work. What i did was, the child actor which the parent actor routed the message to, in it i initialized a property of type IActorRef with the initial sender which is the mvc action. Then after all processing has been done by all the involving actors. I then did initialSender (the iactorRef property).send. Bam, my action received the response from the parent actor.
Aaron Stannard
Jan 10 2017 22:11
Jan 10 2017 23:35
Please is there any recommended way to layer your akka projects. Like for example core, infrastructure, commons, etc..