Versions in this module Expand all Collapse all v0 v0.1.0 Oct 25, 2025 Changes in this version + func SerializeJob(job *Job) ([]byte, error) + type FailedJob struct + Error string + Job *Job + Time time.Time + type Handler interface + Handle func(ctx context.Context, job *Job) error + type Job struct + Attempts int + CreatedAt time.Time + Handler string + ID string + MaxTries int + Payload map[string]interface{} + Queue string + StartedAt *time.Time + Timeout time.Duration + func DeserializeJob(data []byte) (*Job, error) + type JobError struct + Message string + func (e *JobError) Error() string + type Manager struct + func NewManager(queue Queue) *Manager + func (m *Manager) Dispatch(ctx context.Context, handlerName string, payload map[string]interface{}) error + func (m *Manager) Register(name string, handler Handler) + func (m *Manager) Work(ctx context.Context, queueName string) error + type MemoryQueue struct + func NewMemoryQueue() *MemoryQueue + func (m *MemoryQueue) Ack(ctx context.Context, job *Job) error + func (m *MemoryQueue) Close() error + func (m *MemoryQueue) Fail(ctx context.Context, job *Job, err error) error + func (m *MemoryQueue) Failed(ctx context.Context, limit int) ([]*Job, error) + func (m *MemoryQueue) Pop(ctx context.Context, queue string) (*Job, error) + func (m *MemoryQueue) Push(ctx context.Context, job *Job) error + func (m *MemoryQueue) Retry(ctx context.Context, jobID string) error + type Queue interface + Ack func(ctx context.Context, job *Job) error + Close func() error + Fail func(ctx context.Context, job *Job, err error) error + Failed func(ctx context.Context, limit int) ([]*Job, error) + Pop func(ctx context.Context, queue string) (*Job, error) + Push func(ctx context.Context, job *Job) error + Retry func(ctx context.Context, jobID string) error + type RedisClient interface + BLPop func(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error) + Close func() error + Del func(ctx context.Context, keys ...string) error + LPush func(ctx context.Context, key string, values ...interface{}) error + LRange func(ctx context.Context, key string, start, stop int64) ([]string, error) + RPush func(ctx context.Context, key string, values ...interface{}) error + type RedisQueue struct + func NewRedisQueue(client RedisClient, prefix string) *RedisQueue + func (r *RedisQueue) Ack(ctx context.Context, job *Job) error + func (r *RedisQueue) Close() error + func (r *RedisQueue) Fail(ctx context.Context, job *Job, err error) error + func (r *RedisQueue) Failed(ctx context.Context, limit int) ([]*Job, error) + func (r *RedisQueue) Pop(ctx context.Context, queue string) (*Job, error) + func (r *RedisQueue) Push(ctx context.Context, job *Job) error + func (r *RedisQueue) Retry(ctx context.Context, jobID string) error