Ejemplo n.º 1
0
 internal override void Post(ActorRef sender, object message)
 {
     if (!(RouterConfig.IsManagementMessage(message)) &&
         resizer.IsTimeForResize(Interlocked.Increment(ref _resizeCounter) - 1) &&
         Interlocked.Exchange(ref _resizeInProgress, ResizeInProgressState.True) == ResizeInProgressState.False)
     {
         base.Post(Self, new Resize());
     }
     base.Post(sender, message);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="envelope">TBD</param>
        public override void SendMessage(Envelope envelope)
        {
            if (!(RouterConfig.IsManagementMessage(envelope.Message)) &&
                resizer.IsTimeForResize(_resizeCounter.GetAndIncrement()) &&
                _resizeInProgress.CompareAndSet(false, true))
            {
                base.SendMessage(new Envelope(new Resize(), Self, System));
            }

            base.SendMessage(envelope);
        }
Ejemplo n.º 3
0
        public override void SendMessage(IActorRef sender, object message)
        {
            if (!(RouterConfig.IsManagementMessage(message)) &&
                resizer.IsTimeForResize(_resizeCounter.GetAndIncrement()) &&
                _resizeInProgress.CompareAndSet(false, true))
            {
                base.SendMessage(Self, new Resize());
            }

            base.SendMessage(sender, message);
        }
Ejemplo n.º 4
0
 private void SendMessage(IActorRef sender, object message)
 {
     //Route the message via the router to the selected destination.
     if (_routerConfig.IsManagementMessage(message))
     {
         base.Post(sender, message);
     }
     else
     {
         _router.Route(message, sender);
     }
 }