Akka.Actor.Internal.AbstractStash.Stash C# (CSharp) Метод

Stash() публичный Метод

Stashes the current message in the actor's state.
Thrown if we attempt to stash the same message more than once. Thrown in the event that we're using a /// for the and we've exceeded capacity.
public Stash ( ) : void
Результат void
        public void Stash()
        {
            var currMsg = _actorCell.CurrentMessage;
            var sender = _actorCell.Sender;

            if (_actorCell.CurrentEnvelopeId == _currentEnvelopeId)
            {
                 throw new IllegalActorStateException(string.Format("Can't stash the same message {0} more than once", currMsg));
            }
            _currentEnvelopeId = _actorCell.CurrentEnvelopeId;
            
            if(_capacity <= 0 || _theStash.Count < _capacity)
                _theStash.AddLast(new Envelope() { Message = currMsg, Sender = sender });
            else throw new StashOverflowException(string.Format("Couldn't enqueue message {0} to stash of {1}", currMsg, _actorCell.Self));
        }