void SubscribeToSysInboxChannel() { // System inbox is just listening to the notifications, that means that system // messages don't persist. cluster.UnsubscribeChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)); cluster.SubscribeToChannel <RemoteMessageDTO>(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)).Subscribe(SysInbox); }
public void Dispose() { userInbox?.Cancel(); sysInbox?.Cancel(); cluster?.UnsubscribeChannel(ActorInboxCommon.ClusterUserInboxNotifyKey(actor.Id)); cluster?.UnsubscribeChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)); userInbox = null; sysInbox = null; cluster = null; }
public void Dispose() { //tokenSource?.Cancel(); //tokenSource?.Dispose(); //tokenSource = null; userNotify.Cancel(); try { cluster?.UnsubscribeChannel(ActorInboxCommon.ClusterUserInboxNotifyKey(actor.Id)); } catch { }; try { cluster?.UnsubscribeChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)); } catch { }; cluster = null; }
public Unit TellSystem(SystemMessage message, ProcessId sender) => transactionalIO ? ignore(Cluster.PublishToChannel( ActorInboxCommon.ClusterSystemInboxNotifyKey(ProcessId), RemoteMessageDTO.Create(message, ProcessId, sender, Message.Type.System, message.Tag, SessionId, 0))) : ProcessOp.IO(() => { var clientsReached = Cluster.PublishToChannel( ActorInboxCommon.ClusterSystemInboxNotifyKey(ProcessId), RemoteMessageDTO.Create(message, ProcessId, sender, Message.Type.System, message.Tag, SessionId, 0)); return(unit); });
void SubscribeToSysInboxChannel() { cluster.UnsubscribeChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)); cluster.SubscribeToChannel <string>(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id)).Subscribe( msg => { if (sysInbox.Count == 0) { CheckRemoteInbox(ActorInboxCommon.ClusterSystemInboxKey(actor.Id), cluster, actor.Id, sysInbox, userInbox, false); } }); cluster.PublishToChannel(ActorInboxCommon.ClusterSystemInboxNotifyKey(actor.Id), Guid.NewGuid().ToString()); }