memory

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backend

func Backend(ctx context.Context, opts ...config.Option) (backend types.Backend, err error)

Backend is a config.BackendInitializer that initializes a new memory-backed neoq backend

Types

type MemBackend

type MemBackend struct {
	types.Backend
	// contains filtered or unexported fields
}

MemBackend is a memory-backed neoq backend

func (*MemBackend) Enqueue

func (m *MemBackend) Enqueue(ctx context.Context, job *jobs.Job) (jobID string, err error)

Enqueue queues jobs to be executed asynchronously

func (*MemBackend) SetLogger

func (m *MemBackend) SetLogger(logger logging.Logger)

SetLogger sets this backend's logger

func (*MemBackend) Shutdown

func (m *MemBackend) Shutdown(ctx context.Context)

Shutdown halts the worker

func (*MemBackend) Start

func (m *MemBackend) Start(ctx context.Context, queue string, h handler.Handler) (err error)

Start starts processing jobs with the specified queue and handler

func (*MemBackend) StartCron

func (m *MemBackend) StartCron(ctx context.Context, cronSpec string, h handler.Handler) (err error)

StartCron starts processing jobs with the specified cron schedule and handler

See: https://pkg.go.dev/github.com/robfig/cron?#hdr-CRON_Expression_Format for details on the cron spec format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL