Documentation
¶
Index ¶
- Constants
- func StartStatsServer(port int)
- type Args
- type EnqueueData
- type EnqueueOptions
- type Fetcher
- type JobFunc
- type JobStatus
- type Manager
- func (m *Manager) AddBeforeStartHooks(hooks ...func())
- func (m *Manager) AddDuringDrainHooks(hooks ...func())
- func (m *Manager) AddWorker(queue string, concurrency int, job JobFunc, mids ...MiddlewareFunc)
- func (m *Manager) GetRedisClient() *redis.Client
- func (m *Manager) GetStats() (Stats, error)
- func (m *Manager) Producer() *Producer
- func (m *Manager) RetryQueue() string
- func (m *Manager) Run()
- func (m *Manager) Stop()
- type MiddlewareFunc
- type Middlewares
- type Msg
- type Options
- type Producer
- func (p *Producer) Enqueue(queue, class string, args interface{}) (string, error)
- func (p *Producer) EnqueueAt(queue, class string, at time.Time, args interface{}) (string, error)
- func (p *Producer) EnqueueIn(queue, class string, in float64, args interface{}) (string, error)
- func (p *Producer) EnqueueWithOptions(queue, class string, args interface{}, opts EnqueueOptions) (string, error)
- func (p *Producer) GetRedisClient() *redis.Client
- type Stats
- type WorkersLogger
Constants ¶
View Source
const ( DefaultRetryMax = 25 RetryTimeFormat = "2006-01-02 15:04:05 MST" )
View Source
const (
NanoSecondPrecision = 1000000000.0
)
Variables ¶
This section is empty.
Functions ¶
func StartStatsServer ¶ added in v0.8.0
func StartStatsServer(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 JobFunc ¶
func NopMiddleware ¶
NopMiddleware does nothing
type Manager ¶ added in v0.8.0
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v0.8.0
func (*Manager) AddBeforeStartHooks ¶ added in v0.8.0
func (m *Manager) AddBeforeStartHooks(hooks ...func())
func (*Manager) AddDuringDrainHooks ¶ added in v0.8.0
func (m *Manager) AddDuringDrainHooks(hooks ...func())
func (*Manager) AddWorker ¶ added in v0.8.0
func (m *Manager) AddWorker(queue string, concurrency int, job JobFunc, mids ...MiddlewareFunc)
func (*Manager) GetRedisClient ¶ added in v0.8.1
func (*Manager) RetryQueue ¶ added in v0.8.0
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 Options ¶
type Options struct {
ProcessID string
Namespace string
PollInterval int
Database int
Password string
PoolSize int
// Provide one of ServerAddr or (SentinelAddrs + RedisMasterName)
ServerAddr string
SentinelAddrs string
RedisMasterName string
// Optional display name used when displaying manager stats
ManagerDisplayName string
// contains filtered or unexported fields
}
type Producer ¶ added in v0.8.0
type Producer struct {
// contains filtered or unexported fields
}
func NewProducer ¶ added in v0.8.0
func (*Producer) EnqueueWithOptions ¶ added in v0.8.0
func (p *Producer) EnqueueWithOptions(queue, class string, args interface{}, opts EnqueueOptions) (string, error)
func (*Producer) GetRedisClient ¶ added in v0.8.1
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.

