Versions in this module Expand all Collapse all v1 v1.0.1 Jun 16, 2021 Changes in this version + const Memory + const Redis + var ErrMaxAttemptsExceeded = errors.New("queue: max execute attempts") + var ErrQueueClosed = errors.New("queue: Queue closed") + func FakeUniqueID() string + func IFaceToString(value interface{}) string + type DefaultTaskSetting struct + func (task *DefaultTaskSetting) MaxTries() int64 + func (task *DefaultTaskSetting) RetryInterval() int64 + func (task *DefaultTaskSetting) Timeout() time.Duration + type FailedJobHandler func(payload *Payload, err error) error + type JobIFace interface + Attempts func() (attempt int64) + Delete func() (err error) + Failed func(err error) + GetName func() (queueName string) + HasFailed func() (hasFail bool) + IsDeleted func() (deleted bool) + IsReleased func() (released bool) + MarkAsFailed func() + Payload func() (payload *Payload) + PopTime func() (time time.Time) + Queue func() (queue QueueIFace) + Release func(delay int64) (err error) + Timeout func() (time time.Duration) + TimeoutAt func() (time time.Time) + type JobMemory struct + func (job *JobMemory) Attempts() (attempt int64) + func (job *JobMemory) Delete() (err error) + func (job *JobMemory) Failed(err error) + func (job *JobMemory) GetName() (queueName string) + func (job *JobMemory) HasFailed() (hasFail bool) + func (job *JobMemory) IsDeleted() (deleted bool) + func (job *JobMemory) IsReleased() (released bool) + func (job *JobMemory) MarkAsFailed() + func (job *JobMemory) Payload() (payload *Payload) + func (job *JobMemory) PopTime() (time time.Time) + func (job *JobMemory) Queue() (queue QueueIFace) + func (job *JobMemory) Release(delay int64) (err error) + func (job *JobMemory) Timeout() (time time.Duration) + func (job *JobMemory) TimeoutAt() (time time.Time) + type JobRedis struct + func (job *JobRedis) Attempts() (attempt int64) + func (job *JobRedis) Delete() (err error) + func (job *JobRedis) Failed(err error) + func (job *JobRedis) GetName() (queueName string) + func (job *JobRedis) HasFailed() (hasFail bool) + func (job *JobRedis) IsDeleted() (deleted bool) + func (job *JobRedis) IsReleased() (released bool) + func (job *JobRedis) MarkAsFailed() + func (job *JobRedis) Payload() (payload *Payload) + func (job *JobRedis) PopTime() (time time.Time) + func (job *JobRedis) Queue() (queue QueueIFace) + func (job *JobRedis) Release(delay int64) (err error) + func (job *JobRedis) Timeout() (time time.Duration) + func (job *JobRedis) TimeoutAt() (time time.Time) + type Payload struct + Attempts int64 + ID string + MaxTries int64 + Name string + Payload []byte + PopTime int64 + RetryInterval int64 + Timeout int64 + TimeoutAt int64 + func (payload *Payload) RawBody() *RawBody + type Queue struct + func New(driver string, conn interface{}, logger *zap.Logger, concurrent int64) *Queue + func (q *Queue) Bootstrap(tasks []TaskIFace) error + func (q *Queue) BootstrapOne(task TaskIFace) error + func (q *Queue) Delay(task TaskIFace, payload interface{}, duration time.Duration, ID ...string) error + func (q *Queue) DelayAt(task TaskIFace, payload interface{}, delay time.Time, ID ...string) error + func (q *Queue) DelayAtByName(name string, payload interface{}, delay time.Time, ID ...string) error + func (q *Queue) Dispatch(task TaskIFace, payload interface{}) error + func (q *Queue) DispatchByName(name string, payload interface{}) error + func (q *Queue) SetFailedJobHandler(failedJobHandler FailedJobHandler) + func (q *Queue) ShutDown(ctx context.Context) error + func (q *Queue) Size(task TaskIFace) int64 + func (q *Queue) Start() error + type QueueIFace interface + GetConnection func() (connection interface{}, err error) + Later func(queue string, durationTo time.Duration, payload interface{}) (err error) + LaterAt func(queue string, timeAt time.Time, payload interface{}) (err error) + Pop func(queue string) (job JobIFace, exist bool) + Push func(queue string, payload interface{}) (err error) + SetConnection func(connection interface{}) (err error) + Size func(queue string) (size int64) + type RawBody struct + ID string + func (rawBody *RawBody) Bytes() []byte + func (rawBody *RawBody) Int() int + func (rawBody *RawBody) Int64() int64 + func (rawBody *RawBody) String() string + func (rawBody *RawBody) Unmarshal(result interface{}) error + type TaskIFace interface + Execute func(ctx context.Context, job *RawBody) error + MaxTries func() int64 + Name func() string + RetryInterval func() int64 + Timeout func() time.Duration