Documentation
¶
Overview ¶
reference: https://github.com/seomoz/qless-py
Index ¶
- func Bool(reply interface{}, err error) (bool, error)
- func DialConnectTimeout(v time.Duration) dialOptionFn
- func DialDatabase(v int) dialOptionFn
- func DialIdleTimeout(v time.Duration) dialOptionFn
- func DialMaxActive(v int) dialOptionFn
- func DialMaxIdle(v int) dialOptionFn
- func DialMinPingInterval(v time.Duration) dialOptionFn
- func IsJobLost(err error) bool
- func WithDelay(v int) putOptionFn
- func WithDepends(v ...string) putOptionFn
- func WithInterval(v float32) putOptionFn
- func WithJID(v string) putOptionFn
- func WithPriority(v int) putOptionFn
- func WithResources(v ...string) putOptionFn
- func WithRetries(v int) putOptionFn
- func WithTags(v ...string) putOptionFn
- type Client
- func (c *Client) Close()
- func (c *Client) Completed(start, count int) ([]string, error)
- func (c *Client) Do(args ...interface{}) (interface{}, error)
- func (c *Client) Events() *Events
- func (c *Client) Get(jid string) (interface{}, error)
- func (c *Client) GetConfig(option string) (string, error)
- func (c *Client) GetJob(jid string) (Job, error)
- func (c *Client) GetRecurringJob(jid string) (*RecurringJob, error)
- func (c *Client) Queue(name string) Queue
- func (c *Client) Queues() (queues []Queue, err error)
- func (c *Client) SetConfig(option string, value interface{})
- func (c *Client) Tagged(tag string, start, count int) (*TaggedReply, error)
- func (c *Client) Track(jid string) (bool, error)
- func (c *Client) Tracked() (string, error)
- func (c *Client) UnsetConfig(option string)
- func (c *Client) Untrack(jid string) (bool, error)
- type CommandError
- type Events
- type Failure
- type History
- type Job
- type Queue
- type QueueInfo
- type QueueStatistics
- type RecurringJob
- type Resource
- type StatData
- type StringSlice
- type TaggedReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper that converts a command reply to a boolean. If err is not equal to nil, then Bool returns false, err. Otherwise Bool converts the reply to boolean as follows:
Reply type Result integer value != 0, nil bulk strconv.ParseBool(reply) or r != "False", nil nil false, ErrNil other false, error
func DialConnectTimeout ¶
func DialDatabase ¶
func DialDatabase(v int) dialOptionFn
DialDatabase specifies the database to select when establishing a new connection
func DialIdleTimeout ¶
func DialMaxActive ¶
func DialMaxActive(v int) dialOptionFn
func DialMaxIdle ¶
func DialMaxIdle(v int) dialOptionFn
DialMaxIdle specifies the maximum number of idle connections in the pool
func DialMinPingInterval ¶
func WithDepends ¶
func WithDepends(v ...string) putOptionFn
func WithInterval ¶
func WithInterval(v float32) putOptionFn
func WithPriority ¶
func WithPriority(v int) putOptionFn
func WithResources ¶
func WithResources(v ...string) putOptionFn
func WithRetries ¶
func WithRetries(v int) putOptionFn
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetRecurringJob ¶
func (c *Client) GetRecurringJob(jid string) (*RecurringJob, error)
func (*Client) UnsetConfig ¶
type CommandError ¶
type CommandError struct {
Line int
Area string
Message string
// contains filtered or unexported fields
}
func (*CommandError) Error ¶
func (e *CommandError) Error() string
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
func (*Events) Unsubscribe ¶
func (e *Events) Unsubscribe(ch chan<- interface{})
type Failure ¶
type Failure struct {
Group string `json:"group"`
Message string `json:"message"`
When int64 `json:"when"`
Worker string `json:"worker"`
}
func (Failure) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Failure) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Failure) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Failure) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type History ¶
type History struct {
When int64 `json:"when"`
Queue string `json:"q"`
What string `json:"what"`
Worker string `json:"worker"`
}
func (History) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (History) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*History) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*History) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Job ¶
type Job interface {
JID() string
Class() string
State() string
Queue() string
Worker() string
Tracked() bool
Priority() int
Expires() int64
TTL() int64
Retries() int
Remaining() int
Data() string
UnmarshalData(v interface{}) error
Tags() []string
History() []History
Failure() *Failure
Dependents() []string
Dependencies() []string
// operations
Heartbeat() (bool, error)
Fail(group, message string) (bool, error)
Complete() (string, error)
CompleteWithNoData() (string, error)
HeartbeatWithNoData() (bool, error)
Cancel()
Retry(delay int) (int, error)
}
type Queue ¶
type Queue interface {
Name() string
Info() QueueInfo
Jobs(state string, start, count int) ([]string, error)
CancelAll()
Pause()
Resume()
Put(class string, data interface{}, opt ...putOptionFn) (string, error)
PutOrReplace(class string, jid string, data interface{}, opt ...putOptionFn) (int64, error)
PopOne() (j Job, err error)
Pop(count int) ([]Job, error)
Recur(class string, data interface{}, interval int, opt ...putOptionFn) (string, error)
Len() (int64, error)
Stats(time.Time) (*QueueStatistics, error)
}
type QueueInfo ¶
type QueueInfo struct {
Name string `json:"name"`
Paused bool `json:"paused"`
Waiting int `json:"waiting"`
Running int `json:"running"`
Stalled int `json:"stalled"`
Scheduled int `json:"scheduled"`
Recurring int `json:"recurring"`
Depends int `json:"depends"`
}
func (QueueInfo) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (QueueInfo) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*QueueInfo) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*QueueInfo) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type QueueStatistics ¶
type QueueStatistics struct {
Failed int64 `json:"failed"`
Failures int64 `json:"failures"`
Retries int64 `json:"retries"`
Run StatData `json:"run"`
Wait StatData `json:"wait"`
}
func (QueueStatistics) MarshalEasyJSON ¶
func (v QueueStatistics) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (QueueStatistics) MarshalJSON ¶
func (v QueueStatistics) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*QueueStatistics) UnmarshalEasyJSON ¶
func (v *QueueStatistics) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*QueueStatistics) UnmarshalJSON ¶
func (v *QueueStatistics) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type RecurringJob ¶
type RecurringJob struct {
Tags StringSlice
Jid string
Retries int
Data interface{}
Queue string
Interval int
Count int
Klass string
Priority int
// contains filtered or unexported fields
}
func (*RecurringJob) Cancel ¶
func (r *RecurringJob) Cancel()
func (*RecurringJob) Tag ¶
func (r *RecurringJob) Tag(tags ...interface{})
func (*RecurringJob) Untag ¶
func (r *RecurringJob) Untag(tags ...interface{})
func (*RecurringJob) Update ¶
func (r *RecurringJob) Update(opts map[string]interface{})
type StatData ¶
type StatData struct {
Count int64 `json:"count"`
Histogram []int64 `json:"histogram"`
Mean float64 `json:"mean"`
Std float64 `json:"std"`
}
func (StatData) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (StatData) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*StatData) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StatData) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type StringSlice ¶
type StringSlice []string
represents a string slice with special json unmarshalling
func (*StringSlice) UnmarshalJSON ¶
func (s *StringSlice) UnmarshalJSON(data []byte) error
type TaggedReply ¶
type TaggedReply struct {
Total int
Jobs StringSlice
}