Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶ added in v4.1.14
type Handler *func(tbk io.TimeBucketKey, data interface{}) error
Handler gets executed by a shelf on its packages.
func NewShelfHandler ¶
func NewShelfHandler(f func(tbk io.TimeBucketKey, data interface{}) error) Handler
NewShelfHandler creates a new Handler from a supplied function.
type Package ¶
type Package struct { Cancel context.CancelFunc Data interface{} // contains filtered or unexported fields }
Package is a data entry with a context to ensure async execution or cancellation if necessary.
type Shelf ¶
Shelf stores packages, which have shelf lives (^^) and are meant to have the shelf's handler executed after some deadline.
func (*Shelf) Store ¶
func (s *Shelf) Store(tbk *io.TimeBucketKey, data interface{}, deadline *time.Time)
Store a new package to the shelf. This operation cancels, and replaces the existing package with the same TimeBucketKey on the shelf, so make sure not to prematurely store new packages before the previous have a chance to finish naturally.
Click to show internal directories.
Click to hide internal directories.