public Unit TellSystem(SystemMessage message) => unit;
public Unit TellSystem(SystemMessage message, ProcessId sender) => IterRoleMembers(d => d.TellSystem(message, sender));
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);
public Unit TellSystem(SystemMessage message, ProcessId sender) => Raise <Unit>();
public Unit DispatchUnWatch(ProcessId watching) => TellSystem(SystemMessage.DispatchUnWatch(watching), watching);
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;
public static Unit TellSystem(ProcessId pid, SystemMessage message) => GetDispatcher(pid).TellSystem(message, Self);
public Unit Shutdown() => TellSystem(SystemMessage.ShutdownProcess(true), Self);
public Unit Kill() => TellSystem(SystemMessage.ShutdownProcess(false), Self);
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; })); }
public Unit Shutdown() => TellSystem(SystemMessage.ShutdownProcess(true), ActorContext.Self);
public Unit TellSystem(SystemMessage message, ProcessId sender) => ProcessOp.IO(() => Inbox.TellSystem(message));
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; } }); }