Clear() private method

private Clear ( IActorRef self ) : void
self IActorRef
return void
Exemplo n.º 1
0
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="actor">TBD</param>
        protected void ClearActor(ActorBase actor)
        {
            if (actor != null)
            {
                if (actor is IDisposable disposable)
                {
                    try
                    {
                        disposable.Dispose();
                    }
                    catch (Exception e)
                    {
                        _systemImpl.Log?.Error(e, "An error occurred while disposing {0} actor. Reason: {1}",
                                               actor.GetType(), e.Message);
                    }
                }

                ReleaseActor(actor);
                actor.Clear(_systemImpl.DeadLetters);
            }
            _actorHasBeenCleared = true;
            CurrentMessage       = null;

            //TODO: semantics here? should all "_state" be cleared? or just behavior?
            _state = _state.ClearBehaviorStack();
        }
Exemplo n.º 2
0
        protected void ClearActor(ActorBase actor)
        {
            if (actor != null)
            {
                var disposable = actor as IDisposable;
                if (disposable != null)
                {
                    try
                    {
                        disposable.Dispose();
                    }
                    catch (Exception e)
                    {
                        if (_systemImpl.Log != null)
                        {
                            _systemImpl.Log.Error(e, "An error occurred while disposing {0} actor. Reason: {1}",
                                                  actor.GetType(), e.Message);
                        }
                    }
                }

                actor.Clear(_systemImpl.DeadLetters);
            }
            _actorHasBeenCleared = true;
            CurrentMessage       = null;
            behaviorStack        = null;
        }
Exemplo n.º 3
0
 protected void ClearActor(ActorBase actor)
 {
     if (actor != null)
     {
         actor.Clear(_systemImpl.DeadLetters);
     }
     _actorHasBeenCleared = true;
     CurrentMessage       = null;
     behaviorStack        = null;
 }
Exemplo n.º 4
0
 protected void ClearActor()
 {
     if (_actor != null)
     {
         _actor.Clear(System.DeadLetters);
     }
     _actorHasBeenCleared = true;
     CurrentMessage       = null;
     behaviorStack        = null;
 }
Exemplo n.º 5
0
        protected void ClearActor(ActorBase actor)
        {
            if (actor != null)
            {
                var disposable = actor as IDisposable;
                if (disposable != null)
                {
                    try
                    {
                        disposable.Dispose();
                    }
                    catch (Exception e)
                    {
                        if (_systemImpl.Log != null)
                        {
                            _systemImpl.Log.Error(e, "An error occurred while disposing {0} actor. Reason: {1}", 
                                actor.GetType(), e.Message);
                        }
                    }
                }

                actor.Clear(_systemImpl.DeadLetters);
            }
            _actorHasBeenCleared = true;
            CurrentMessage = null;

            //TODO: semantics here? should all "_state" be cleared? or just behavior?
            _state = _state.ClearBehaviorStack();
        }
Exemplo n.º 6
0
        protected void ClearActor(ActorBase actor)
        {
            if (actor != null)
            {
                var disposable = actor as IDisposable;
                if (disposable != null)
                {
                    try
                    {
                        disposable.Dispose();
                    }
                    catch (Exception e)
                    {
                        if (_systemImpl.Log != null)
                        {
                            _systemImpl.Log.Error(e, "An error occurred while disposing {0} actor. Reason: {1}", 
                                actor.GetType(), e.Message);
                        }
                    }
                }

                actor.Clear(_systemImpl.DeadLetters);
            }
            _actorHasBeenCleared = true;
            CurrentMessage = null;
            behaviorStack = null;
        }