Documentation
¶
Overview ¶
Package worker is the library's own background goroutine group -- the mail drain and the token, limiter and signup sweeps -- as distinct from App.Lifecycle, which is the application's.
A Job is either a long-lived loop (Every == 0) or a periodic pass. A panicking job is recovered and logged rather than taking the process down with it. Stop waits for every job to return, and the HTTP server drains before the jobs do, so a mail queued by the last request in flight still goes out. See docs/design.md, FR-7.11 and FR-7.12.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group runs a set of jobs until their context is done.
type Job ¶
Job is one background task.
When Every is zero, Run is a long-lived loop: it is called once and must return when its context is done (the mail drain is one). Otherwise Run is a periodic pass, called once at start and then on every tick (the token sweep is one).
An error is logged, never fatal.