sqlite

package
v0.0.0-...-b090c36 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobQuery = `` /* 175-byte string literal not displayed */

	AllPendingJobIDQuery = `SELECT id
					FROM neoq_jobs
					WHERE queue = $1
					AND status != "processed"
					AND run_after < datetime("now")`
	FutureJobQuery = `` /* 234-byte string literal not displayed */

)

Variables

View Source
var (
	ErrNoTransactionInContext = errors.New("context does not have a Tx set")
	ErrDuplicateJob           = errors.New("duplicate job")
)

Functions

func Backend

func Backend(ctx context.Context, opts ...neoq.ConfigOption) (sb neoq.Neoq, err error)

func WithConnectionString

func WithConnectionString(connectionString string) neoq.ConfigOption

Types

type SqliteBackend

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

func (*SqliteBackend) Enqueue

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

Enqueue adds jobs to the specified queue

func (*SqliteBackend) SetLogger

func (s *SqliteBackend) SetLogger(logger logging.Logger)

SetLogger sets this backend's logger

func (*SqliteBackend) Shutdown

func (s *SqliteBackend) Shutdown(ctx context.Context)

Shutdown shuts this backend down

func (*SqliteBackend) Start

func (s *SqliteBackend) Start(ctx context.Context, h handler.Handler) (err error)

Start starts processing jobs with the specified queue and handler

func (*SqliteBackend) StartCron

func (s *SqliteBackend) 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