Documentation ¶
Overview ¶
Package queue provides a queue interface
Package queue provides a common queue interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorScanCancel can be returned by the scan handler to stop scanning ErrorScanCancel = Error(errors.New("scan canceled")) )
Functions ¶
func RegisterProvider ¶
RegisterProvider makes a database provider available by the provided name. If RegisterProvider is called twice with the same name or if provider is nil, it panics.
Types ¶
type Message ¶
type Message interface { // MessageID returns a unique message identifier MessageID() string // Body returns the message body as []byte Body() []byte // Attributes returns the message attributes as a map Attributes() types.StringMap }
Message is a queue message interface
type Provider ¶
type Provider interface { // Publish publishes the message body with optioanl attributes and return the id Publish(body []byte, attributes ...types.StringMap) (string, error) // Scan performs a canceleable scan on the queue Scan(ctx context.Context, handler func(msg Message) error) error }
Provider defines a queue interface
Click to show internal directories.
Click to hide internal directories.