Given a mutable borrow to an ActorContext -- i.e. you're in
Actor::receive or Actor::receive_context, this allows immediate
stopping or failing of the actor.
This contrasts with ActorRef::stop and ActorRef::fail where they are
enqueued like regular messages.
Basically, from the inside, you can stop yourself (effectively)
immediately, whereas from the outside you don't have control over the
message ordering.
Given a mutable borrow to an
ActorContext
-- i.e. you're inActor::receive
orActor::receive_context
, this allows immediate stopping or failing of the actor.This contrasts with
ActorRef::stop
andActorRef::fail
where they are enqueued like regular messages.Basically, from the inside, you can stop yourself (effectively) immediately, whereas from the outside you don't have control over the message ordering.