public UserSupervisor() { _log = Logging.GetLogger(Context); _log.Warning("UserSupervisor started at '{0}'", Self.Path); _finder = Context.ActorOfDI <UserFinder>("Finder"); Receive <LoadUserRequest>(rq => OnLoadUserRequest(rq)); Receive <UserProfile>(rq => OnLoadUserProfile(rq)); }
private void OnLoadUserProfile(UserProfile rq) { // Create the child actor and give it the loaded profile var child = Context.ActorOfDI <User>(rq.ExternalUserId); child.Tell(rq, Context.Self); // And then tell the original Sender that we've loaded the iser Sender.Tell(new LoadUserResponse(true, child)); }