Documentation
¶
Overview ¶
Package bqueue is a "in memory" queue.
Index ¶
Constants ¶
View Source
const ( // DefaultLimit is the default job queue limit. DefaultLimit = 128 // UnlimitedWorkers can passed to Workers when run in dynamic // mode to use an unlimited amount of workers. UnlimitedWorkers = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job interface {
Process()
}
Job is implemented by types which can be processed by Queue.
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger is implemented by types which an be used by Queue as a log destination.
type Option ¶
Option represents a queue option.
func Limit ¶
Limit sets the maximum number of jobs queued before an error is returned. Default is DefaultLimit maximum queued jobs..
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue processes jobs.
func (*Queue) QueueNonBlocking ¶
QueueNonBlocking queues a job in non blocking mode. If the maximum buffer as defined by Limit is already filled an error will be returned.
Click to show internal directories.
Click to hide internal directories.