Documentation ¶
Index ¶
- Constants
- Variables
- func Backend(ctx context.Context, opts ...neoq.ConfigOption) (sb neoq.Neoq, err error)
- func WithConnectionString(connectionString string) neoq.ConfigOption
- type SqliteBackend
- func (s *SqliteBackend) Enqueue(ctx context.Context, job *jobs.Job) (jobID string, err error)
- func (s *SqliteBackend) SetLogger(logger logging.Logger)
- func (s *SqliteBackend) Shutdown(ctx context.Context)
- func (s *SqliteBackend) Start(ctx context.Context, h handler.Handler) (err error)
- func (s *SqliteBackend) StartCron(ctx context.Context, cronSpec string, h handler.Handler) (err error)
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 WithConnectionString ¶
func WithConnectionString(connectionString string) neoq.ConfigOption
Types ¶
type SqliteBackend ¶
type SqliteBackend struct { neoq.Neoq // contains filtered or unexported fields }
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) 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
Click to show internal directories.
Click to hide internal directories.