Difference between Signal (Kill) and Stop
mainChoosing between Signal::Kill and Stop depends on whether you need a graceful shutdown:
- Signal (Kill):
- Highest priority and immediate.
- Terminates all work, including currently executing async handlers.
- Cancellation is immediate and not graceful.
- Use for forced termination or emergency shutdowns.
- Stop:
- Graceful termination: currently executing async work is allowed to finish.
- The actor transitions to exiting on the next message processing iteration.
- Use for normal shutdowns where cleanup logic must run.
Important: Stop does not interrupt running handlers. If you require an immediate stop, send Kill.