Versions in this module Expand all Collapse all v1 v1.1.0 May 12, 2026 v1.0.13 May 12, 2026 Changes in this version + var ErrJobExists = errors.New("job already exists") + var ErrRequeue = errors.New("requeue") + var ErrScheduleStop = fmt.Errorf("stop") + type Job struct + CreatedAt time.Time + Key string + NodeID string + Payload []byte + Worker *Worker + type JobHandler interface + Start func(job *Job) error + Stop func(key string) error + type JobParam struct + Key string + Payload []byte + type JobPlan struct + Start []*JobParam + Stop []string + StopAll bool + type JobProducer interface + Name func() string + Plan func() (*JobPlan, error) + type Node struct + ID string + PoolName string + func AddNode(ctx context.Context, poolName string, rdb *redis.Client, opts ...NodeOption) (*Node, error) + func (node *Node) AddWorker(ctx context.Context, handler JobHandler) (*Worker, error) + func (node *Node) Close(ctx context.Context) error + func (node *Node) DispatchJob(ctx context.Context, key string, payload []byte) error + func (node *Node) IsClosed() bool + func (node *Node) IsShutdown() bool + func (node *Node) JobKeys() []string + func (node *Node) JobPayload(key string) ([]byte, bool) + func (node *Node) NewTicker(ctx context.Context, name string, d time.Duration, opts ...TickerOption) (*Ticker, error) + func (node *Node) NotifyWorker(ctx context.Context, key string, payload []byte) error + func (node *Node) PoolWorkers() []*Worker + func (node *Node) RemoveWorker(ctx context.Context, w *Worker) error + func (node *Node) Schedule(ctx context.Context, producer JobProducer, interval time.Duration) error + func (node *Node) Shutdown(ctx context.Context) error + func (node *Node) StopJob(ctx context.Context, key string) error + func (node *Node) Workers() []*Worker + type NodeOption func(*nodeOptions) + func WithAckGracePeriod(ttl time.Duration) NodeOption + func WithClientOnly() NodeOption + func WithJobSinkBlockDuration(d time.Duration) NodeOption + func WithLogger(logger pulse.Logger) NodeOption + func WithMaxQueuedJobs(max int) NodeOption + func WithWorkerShutdownTTL(ttl time.Duration) NodeOption + func WithWorkerTTL(ttl time.Duration) NodeOption + type NotificationHandler interface + HandleNotification func(key string, payload []byte) error + type Ticker struct + C <-chan time.Time + func (t *Ticker) Close() + func (t *Ticker) Stop() + type TickerOption func(*tickerOptions) + func WithTickerLogger(logger pulse.Logger) TickerOption + type Worker struct + CreatedAt time.Time + ID string + func (w *Worker) IsStopped() bool + func (w *Worker) Jobs() []*Job