Documentation
¶
Index ¶
- Constants
- func AddGlobalMiddleware(mw tasker.JobMiddleware)
- func Cancel(ctx context.Context, id tasker.JobID) (*tasker.JobRow, error)
- func Chain(ctx context.Context, jobs []tasker.Job, opts ...tasker.DispatchOpt) ([]*tasker.JobRow, error)
- func Dispatch(ctx context.Context, job tasker.Job, opts ...tasker.DispatchOpt) (*tasker.JobRow, error)
- func DispatchBatch(ctx context.Context, jobs []tasker.Job, opts ...tasker.DispatchOpt) ([]*tasker.JobRow, error)
- func GetJob(ctx context.Context, id tasker.JobID) (*tasker.JobRow, error)
- func RegisterJob(name string, factory tasker.JobFactory)
- func Retry(ctx context.Context, id tasker.JobID) (*tasker.JobRow, error)
- type Config
- type QueueProvider
Constants ¶
View Source
const ConfigStub = `` /* 653-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AddGlobalMiddleware ¶
func AddGlobalMiddleware(mw tasker.JobMiddleware)
func DispatchBatch ¶
func RegisterJob ¶
func RegisterJob(name string, factory tasker.JobFactory)
Types ¶
type Config ¶
type Config struct {
Driver string
DSN string
DriverName string
TablePrefix string
RoutePrefix string
MaxOpenConns int
MaxIdleConns int
RedisAddr string
RedisPass string
RedisDB int
RedisPrefix string
DefaultQueue string
DefaultMaxAttempts int
Workers map[string]int
EnableAutoscale bool
HeartbeatInterval int
RequeueTimeout int
PruneAfterHours int
}
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) ApplyOverrides ¶
ApplyOverrides reads from a config.M (the "tasker" section) and overrides matching fields on the Config. Keys are flat (no "tasker." prefix).
func (*Config) AutoFillDatabase ¶
AutoFillDatabase reads the app's default SQL connection config and fills DSN/DriverName. Only applies when Driver is "sql" and DSN is empty.
type QueueProvider ¶
type QueueProvider struct {
Config *Config
}
func (*QueueProvider) AddCommands ¶
func (p *QueueProvider) AddCommands() []app.Command
func (*QueueProvider) AddPublishables ¶
func (p *QueueProvider) AddPublishables() []*app.Publishable
func (*QueueProvider) AddRoutes ¶
func (p *QueueProvider) AddRoutes() app.RouteCallback
Click to show internal directories.
Click to hide internal directories.