Documentation ¶
Overview ¶
Each process should return a valid exitreason.S when it's [Runable.Receive] returns. The specific kind of return will influence how higher order components such as Supervisors and Registries handle process exits.
In the event a process exits unexpectedly (ie. panic), then an Exception reason is returned.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // A normal process exit. Normal = &S{short: normal} // Indicates a process's Supervisor terminated the process. Also considered a "Normal" exit. SupervisorShutdown = &S{short: supervisorShutdown} // The pid or name does not identifiy an active process NoProc = &S{short: noProc} // Returned when a request exceeds it's specified timeout. Timeout = &S{short: timeout} // This is special type of exit reason that would allow a Supervisor to ignore // a genserver that doesn't start while keeping it's child specification around // so it can be started later. Ignore = &S{short: ignore} // Untrappable exit signal. Kill = &S{short: kill} // The process stopped after replying to a Call Stopped = &S{short: stopped} TestExit = &S{short: testExit} )
Sentinel errors
Functions ¶
func Exception ¶
General "error" exitreason. Returned when a process panicks or exits with an error.
func Shutdown ¶
Returned when a process is exiting cleanly. Optionally provide additional info that will be returned to monitors/links. Considered a "Normal" exit.
func Wrap ¶
Takes any error and if it is not a *S, then wraps it as an exitreason.Exception
Types ¶
type S ¶
type S struct {
// contains filtered or unexported fields
}
Opaque return type. Use functions in this package to create new instances and test with the `Is*(exitreason) bool` functions.
For convienence it implements the errors and [stringer] interfaces.
func IsExitReason ¶
Tests to see if error is or wraps a *S. If not, returns nil
func (*S) ExceptionDetail ¶
func (*S) ShutdownReason ¶
Shutdown exitreasons include optional information