コード例 #1
0
        void SubscribeToScheduleInboxChannel()
        {
            cluster.UnsubscribeChannel(ActorInboxCommon.ClusterScheduleNotifyKey(actor.Id));
            cluster.SubscribeToChannel <string>(ActorInboxCommon.ClusterScheduleNotifyKey(actor.Id)).Subscribe(msg => scheduledItems++);
            // We want the check done asyncronously, in case the setup function creates child processes that
            // won't exist if we invoke directly.

            // TODO: Consider the implications of race condition here --- will probably need some large 'clear out' process that does a query
            //       on the cluster.  Or maybe this internal counter isn't the best approach.
            scheduledItems = cluster.GetHashFields(ActorInboxCommon.ClusterScheduleKey(actor.Id)).Count;
        }