public Unit TellSystem(SystemMessage message) => unit;
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 IterRoleMembers(d => d.TellSystem(message, sender));
Beispiel #3
0
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 ProcessOp.IO(() =>
 {
     var dto            = RemoteMessageDTO.Create(message, ProcessId, sender, Message.Type.System, message.Tag);
     var clientsReached = Cluster.PublishToChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(ProcessId), dto);
 });
 public Unit Kill() =>
 // TODO: Not yet implemented on the JS side
 ProcessId.Tell(SystemMessage.ShutdownProcess(false), ActorContext.Self);
Beispiel #5
0
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 Raise <Unit>();
Beispiel #6
0
 public Unit DispatchUnWatch(ProcessId watching) =>
 TellSystem(SystemMessage.DispatchUnWatch(watching), watching);
Beispiel #7
0
 public Unit Kill() =>
 TellSystem(SystemMessage.ShutdownProcess(false), ActorContext.Self);
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 Tell(message, sender, "user", Message.Type.System, message.Tag);
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 unit;
Beispiel #10
0
 public static Unit TellSystem(ProcessId pid, SystemMessage message) =>
 GetDispatcher(pid).TellSystem(message, Self);
Beispiel #11
0
 public Unit Shutdown() =>
 TellSystem(SystemMessage.ShutdownProcess(true), Self);
Beispiel #12
0
 public Unit Kill() =>
 TellSystem(SystemMessage.ShutdownProcess(false), Self);
Beispiel #13
0
 public Unit TellSystem(SystemMessage message) => unit;
        public static InboxDirective SystemMessageInbox <S, T>(Actor <S, T> actor, IActorInbox inbox, SystemMessage msg, ActorItem parent)
        {
            return(ActorContext.WithContext(new ActorItem(actor, inbox, actor.Flags), parent, ProcessId.NoSender, null, msg, msg.SessionId, () =>
            {
                switch (msg.Tag)
                {
                case Message.TagSpec.Restart:
                    if (inbox.IsPaused)
                    {
                        inbox.Unpause();
                    }
                    actor.Restart();
                    break;

                case Message.TagSpec.LinkChild:
                    var lc = msg as SystemLinkChildMessage;
                    actor.LinkChild(lc.Child);
                    break;

                case Message.TagSpec.UnlinkChild:
                    var ulc = msg as SystemUnLinkChildMessage;
                    actor.UnlinkChild(ulc.Child);
                    break;

                case Message.TagSpec.ChildFaulted:
                    var cf = msg as SystemChildFaultedMessage;
                    return actor.ChildFaulted(cf.Child, cf.Sender, cf.Exception, cf.Message);

                case Message.TagSpec.StartupProcess:
                    actor.Startup();
                    break;

                case Message.TagSpec.ShutdownProcess:
                    var sp = msg as ShutdownProcessMessage;
                    actor.ShutdownProcess(sp.MaintainState);
                    break;

                case Message.TagSpec.Unpause:
                    inbox.Unpause();
                    break;

                case Message.TagSpec.Pause:
                    inbox.Pause();
                    break;

                case Message.TagSpec.Watch:
                    var awm = msg as SystemAddWatcherMessage;
                    actor.AddWatcher(awm.Id);
                    break;

                case Message.TagSpec.UnWatch:
                    var rwm = msg as SystemRemoveWatcherMessage;
                    actor.RemoveWatcher(rwm.Id);
                    break;

                case Message.TagSpec.DispatchWatch:
                    var dwm = msg as SystemDispatchWatchMessage;
                    actor.DispatchWatch(dwm.Id);
                    break;

                case Message.TagSpec.DispatchUnWatch:
                    var duwm = msg as SystemDispatchUnWatchMessage;
                    actor.DispatchUnWatch(duwm.Id);
                    break;
                }
                return InboxDirective.Default;
            }));
        }
Beispiel #15
0
 public Unit Shutdown() =>
 TellSystem(SystemMessage.ShutdownProcess(true), ActorContext.Self);
Beispiel #16
0
 public Unit TellSystem(SystemMessage message, ProcessId sender) =>
 ProcessOp.IO(() => Inbox.TellSystem(message));
Beispiel #17
0
 public Unit UnWatch(ProcessId pid) =>
 TellSystem(SystemMessage.UnWatch(pid), pid);
 public Unit Shutdown() =>
 // TODO: Not yet implemented on the JS side
 ProcessId.Tell(SystemMessage.ShutdownProcess(true), Self);
        public static void SystemMessageInbox <S, T>(Actor <S, T> actor, IActorInbox inbox, SystemMessage msg, ActorItem parent)
        {
            ActorContext.WithContext(new ActorItem(actor, inbox, actor.Flags), parent, ProcessId.NoSender, null, msg, () =>
            {
                switch (msg.Tag)
                {
                case Message.TagSpec.Restart:
                    actor.Restart();
                    break;

                case Message.TagSpec.LinkChild:
                    var lc = msg as SystemLinkChildMessage;
                    actor.LinkChild(lc.Child);
                    break;

                case Message.TagSpec.UnlinkChild:
                    var ulc = msg as SystemUnLinkChildMessage;
                    actor.UnlinkChild(ulc.Child);
                    break;
                }
            });
        }