Documentation
¶
Index ¶
- Variables
- type DelayQueue
- func (q *DelayQueue) Delete(ctx context.Context, id string) error
- func (q *DelayQueue) DeleteBatch(ctx context.Context, ids []string) error
- func (q *DelayQueue) Enqueue(ctx context.Context, job Job) (string, error)
- func (q *DelayQueue) EnqueueBatch(ctx context.Context, jobs []Job) ([]string, error)
- func (q *DelayQueue) Shutdown() error
- func (q *DelayQueue) Start(ctx context.Context, handler Handler) error
- type Handler
- type IDGenerator
- type Job
- type Option
- func WithBatchSize(n int) Option
- func WithChunkInterval(d time.Duration) Option
- func WithConcurrency(n int) Option
- func WithHotWindow(d time.Duration) Option
- func WithIDGenerator(fn IDGenerator) Option
- func WithLeaseTimeout(d time.Duration) Option
- func WithPollingInterval(d time.Duration) Option
- func WithPromoteInterval(d time.Duration) Option
- func WithPromoteRefreshInterval(d time.Duration) Option
- func WithQueue(queue string) Option
- func WithQueueDepth(n int) Option
- func WithRetention(d time.Duration) Option
- func WithSchema(schema string) Option
- func WithShardNum(n int) Option
- func WithSnowflakeDSN(dsn string) Option
- func WithSnowflakeEpoch(epoch int64) Option
- func WithSnowflakeTable(table string) Option
- func WithTable(table string) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilPostgres = errors.New("jobx: postgres pool is nil") ErrNilRedis = errors.New("jobx: redis client is nil") ErrInvalidJob = errors.New("jobx: invalid job") ErrInvalidOption = errors.New("jobx: invalid option") ErrQueueClosed = errors.New("jobx: delay queue is closed") ErrAlreadyStarted = errors.New("jobx: delay queue already started") ErrMissingHandler = errors.New("jobx: handler is nil") ErrMissingIDSource = errors.New("jobx: id generator returned empty id") )
Functions ¶
This section is empty.
Types ¶
type DelayQueue ¶
type DelayQueue struct {
// contains filtered or unexported fields
}
func NewDelayQueue ¶
func (*DelayQueue) DeleteBatch ¶
func (q *DelayQueue) DeleteBatch(ctx context.Context, ids []string) error
func (*DelayQueue) EnqueueBatch ¶
func (*DelayQueue) Shutdown ¶
func (q *DelayQueue) Shutdown() error
type IDGenerator ¶
type IDGenerator func() string
type Option ¶
type Option func(*options)
func WithBatchSize ¶
func WithChunkInterval ¶
func WithConcurrency ¶
func WithHotWindow ¶
func WithIDGenerator ¶
func WithIDGenerator(fn IDGenerator) Option
func WithLeaseTimeout ¶
func WithPollingInterval ¶
func WithPromoteInterval ¶
func WithQueueDepth ¶
func WithRetention ¶
func WithSchema ¶
func WithShardNum ¶
func WithSnowflakeDSN ¶
func WithSnowflakeEpoch ¶
func WithSnowflakeTable ¶
Click to show internal directories.
Click to hide internal directories.