config

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultIdleTxTimeout = 30000
	// the window of time between time.Now() and when a job's RunAfter comes due that neoq will schedule a goroutine to
	// schdule the job for execution.
	// E.g. right now is 16:00 and a job's RunAfter is 16:30 of the same date. This job will get a dedicated goroutine to
	// wait until the job's RunAfter, scheduling the job to be run exactly at RunAfter
	DefaultFutureJobWindow    = 30 * time.Second
	DefaultJobCheckInterval   = 5 * time.Second
	DefaultTransactionTimeout = time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendInitializer

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

BackendInitializer is a function that initializes a backend

type Config

type Config struct {
	BackendInitializer     BackendInitializer
	ConnectionString       string        // a string containing connection details for the backend
	FutureJobWindow        time.Duration // the window of time between now and RunAfter that goroutines are scheduled for future jobs
	JobCheckInterval       time.Duration // the interval of time between checking for new future/retry jobs
	IdleTransactionTimeout int           // the number of milliseconds PgBackend transaction may idle before the connection is killed
}

func New

func New() *Config

New initiailizes a new Config with defaults

type Option

type Option func(c *Config)

Option is a function that sets optional backend configuration

func WithConnectionString

func WithConnectionString(connectionString string) Option

WithConnectionString configures neoq to use the specified connection string when connecting to a backend

Jump to

Keyboard shortcuts

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