예제 #1
0
 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);
 }
예제 #2
0
 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;
 }
예제 #3
0
        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;
        }
예제 #4
0
 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);
 });
예제 #5
0
 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());
 }