Clarify temporal semantics for RunShutdownable.Shutdown

This commit is contained in:
Sasha Koshka 2025-01-30 18:27:37 -05:00
parent bbe833bb53
commit 2cb1e5cb3a

View File

@ -99,9 +99,8 @@ type RunShutdownable interface {
// non-nil error explaining why. Shutdown does not need to be called in
// the latter case.
Run() error
// Shutdown shuts down the actor. It must be called while Run is
// running, and it must unblock Run even if it fails, the context
// expires, it returns an error, etc. Shutdown must return when or
// Shutdown shuts down the actor. It must unblock Run in all cases even
// on failure, context expiration, etc. Shutdown must return when or
// before the context expires, and must return ctx.Err if there is no
// other error to be returned. If Shutdown returns any error, the object
// must be treated as invalid and any other process which depends on it