pantomime-rs / pantomime

MIT License
5 stars 1 forks source link

Implement `ActorContext::stop` and `ActorContext::fail` #32

Closed longshorej closed 5 years ago

longshorej commented 5 years ago

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.