Akka.Actor.RepointableActorRef.SwapUnderlying C# (CSharp) Метод

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

public SwapUnderlying ( ICell cell ) : void
cell ICell
Результат void
        public void SwapUnderlying(ICell cell)
        {
#pragma warning disable 0420
            //Ok to ignore CS0420 "a reference to a volatile field will not be treated as volatile" for interlocked calls http://msdn.microsoft.com/en-us/library/4bw5ewxy(VS.80).aspx
            Interlocked.Exchange(ref _underlying_DoNotCallMeDirectly, cell);
#pragma warning restore 0420
        }

Usage Example

Пример #1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="cell">TBD</param>
        public void ReplaceWith(ICell cell)
        {
            lock (_lock)
            {
                try
                {
                    DrainSysMsgQueue(cell);

                    while (_messageQueue.Count > 0)
                    {
                        // roughly equal to what "poll" does
                        var e = _messageQueue.First.Value;
                        _messageQueue.RemoveFirst();
                        cell.SendMessage(e.Sender, e.Message);

                        // drain sysmsgQueue in case a msg enqueues a sys msg
                        DrainSysMsgQueue(cell);
                    }
                }
                finally
                {
                    _self.SwapUnderlying(cell);
                }
            }
        }
All Usage Examples Of Akka.Actor.RepointableActorRef::SwapUnderlying