Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NowMonotonic ¶
NowMonotonic is like time.Now, but the result is monotonically increasing, and does not necessarily correspond to the actual current time.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
A Daemon is a handle on a daemon goroutine which allows for the scheduling and execution of timeouts and their related callbacks.
func NewDaemon ¶
NewDaemon starts a new daemon and returns a handle to it. A lock on locker will be acquired before any timeout's callback is executed.
func (*Daemon) AddTimeout ¶
AddTimeout schedules f to be called at time t, which must be calculated relative to NowMonotonic (not time.Now). The returned *Timeout can be used to cancel the timeout, in which case f will not be called. It is guaranteed
that f will not be called before time t.
Click to show internal directories.
Click to hide internal directories.