Documentation
¶
Overview ¶
Package bg tracks the process's fire-and-forget goroutines (a re-auth email, a close hook's push, a detached write) so shutdown can wait for them, bounded, instead of closing the database under them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = &Group{}
Default is the process-wide group; main waits on it at shutdown.
Functions ¶
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group counts running goroutines. It is a counter under a mutex rather than a sync.WaitGroup because a hook can start new work while shutdown is already waiting, and WaitGroup panics on an Add that races a Wait at zero.
Click to show internal directories.
Click to hide internal directories.