memory

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backend

func Backend(_ context.Context, opts ...neoq.ConfigOption) (backend neoq.Neoq, err error)

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

Types

type MemBackend

type MemBackend struct {
	neoq.Neoq
	// contains filtered or unexported fields
}

MemBackend is a memory-backed neoq backend

func (*MemBackend) Enqueue

func (m *MemBackend) Enqueue(_ 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(_ context.Context)

Shutdown halts the worker

func (*MemBackend) Start

func (m *MemBackend) Start(ctx context.Context, 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