private void HandleRegisterSupervisor(RegisterSupervisor m)
        {
            // Register the supervisor
            SupervisorInfo sI = new SupervisorInfo(m.ActorType, m.ResgistrationArea, m.Requestor);

            if (_KnownSupervisorsActors.Keys.Contains(sI.Area))
            {
                _KnownSupervisorsActors[sI.Area] = sI;
            }
            else
            {
                _KnownSupervisorsActors.Add(sI.Area, sI);
            }

            // Let the Supervisor know that we got it...
            Sender.Tell(new SupervisorRegistrationEvent(m, true));
        }
Esempio n. 2
0
        private void AttemptSupervisorRegistrationHelper()
        {
            // Register this supervisor with the SupervisorRegister so that the Bridge(s) can find it
            RegisterSupervisor registration = new RegisterSupervisor(Self, _ActorType, General.MicroServices.Area.Client);

            _SupervisorRegistry.Ask <object>(registration, _registerTimeout).ContinueWith <SupervisorRegistrationEvent>(te =>
            {
                object o = te.Result;
                SupervisorRegistrationEvent rEvt = null;
                if (o.GetType() == typeof(SupervisorRegistrationEvent))
                {
                    rEvt = te.Result as SupervisorRegistrationEvent;
                }

                if (te.IsFaulted || te.IsCanceled)
                {
                    return(new SupervisorRegistrationEvent(rEvt.RegisteredSupervisor, false));
                }
                return(new SupervisorRegistrationEvent(rEvt.RegisteredSupervisor, true));
            }).PipeTo <SupervisorRegistrationEvent>(Self);
        }
 public SupervisorRegistrationEvent(RegisterSupervisor rs, bool registered)
 {
     RegisteredSupervisor = rs;
     Registered           = registered;
 }
 public SupervisorInfo(RegisterSupervisor rsMsg)
 {
     ActorType = rsMsg.ActorType;
     Area      = rsMsg.Area;
     SupervisorActorReference = rsMsg.Requestor;
 }