Documentation
¶
Index ¶
- Constants
- Variables
- func BeforeStart(f func())
- func Configure(options Options) error
- func DuringDrain(f func())
- func Enqueue(queue, class string, args interface{}) (string, error)
- func EnqueueAt(queue, class string, at time.Time, args interface{}) (string, error)
- func EnqueueIn(queue, class string, in float64, args interface{}) (string, error)
- func EnqueueWithOptions(queue, class string, args interface{}, opts EnqueueOptions) (string, error)
- func Process(queue string, job JobFunc, concurrency int, mids ...MiddlewareFunc)
- func Quit()
- func ResetManagers() error
- func Run()
- func Start()
- func Stats(w http.ResponseWriter, req *http.Request)
- func StatsServer(port int)
- type Args
- type EnqueueData
- type EnqueueOptions
- type Fetcher
- type JobFunc
- type MiddlewareFunc
- type Middlewares
- type Msg
- type Options
- type WorkersLogger
Constants ¶
View Source
const ( DefaultRetryMax = 25 RetryTimeFormat = "2006-01-02 15:04:05 MST" )
View Source
const ( RETRY_KEY = "goretry" SCHEDULED_JOBS_KEY = "schedule" )
View Source
const (
NanoSecondPrecision = 1000000000.0
)
Variables ¶
View Source
var Config *config
Functions ¶
func BeforeStart ¶
func BeforeStart(f func())
func DuringDrain ¶
func DuringDrain(f func())
func EnqueueWithOptions ¶
func EnqueueWithOptions(queue, class string, args interface{}, opts EnqueueOptions) (string, error)
func ResetManagers ¶
func ResetManagers() error
func StatsServer ¶
func StatsServer(port int)
Types ¶
type EnqueueData ¶
type EnqueueData struct {
Queue string `json:"queue,omitempty"`
Class string `json:"class"`
Args interface{} `json:"args"`
Jid string `json:"jid"`
EnqueuedAt float64 `json:"enqueued_at"`
EnqueueOptions
}
type EnqueueOptions ¶
type Fetcher ¶
type JobFunc ¶
func LogMiddleware ¶
func NopMiddleware ¶
NopMiddleware does nothing
func RetryMiddleware ¶
func StatsMiddleware ¶
type MiddlewareFunc ¶
type Middlewares ¶
type Middlewares []MiddlewareFunc
func DefaultMiddlewares ¶
func DefaultMiddlewares() Middlewares
func NewMiddlewares ¶
func NewMiddlewares(mids ...MiddlewareFunc) Middlewares
func (Middlewares) Append ¶
func (m Middlewares) Append(mid MiddlewareFunc) Middlewares
func (Middlewares) Prepend ¶
func (m Middlewares) Prepend(mid MiddlewareFunc) Middlewares
type WorkersLogger ¶
type WorkersLogger interface {
Println(...interface{})
Printf(string, ...interface{})
}
var Logger WorkersLogger = log.New(os.Stdout, "workers: ", log.Ldate|log.Lmicroseconds)
Click to show internal directories.
Click to hide internal directories.

