Documentation
¶
Index ¶
- Variables
- type App
- func (a *App) Client() *asynq.Client
- func (a *App) Enqueue(ctx context.Context, task *asynq.Task, opts ...asynq.Option) (*asynq.TaskInfo, error)
- func (a *App) Inspector() *asynq.Inspector
- func (a *App) RegisterTasks(ctx context.Context, handlers []TaskHandler)
- func (a *App) RunScheduler() error
- func (a *App) RunWorker(ctx context.Context) error
- func (a *App) Shutdown(ctx context.Context) error
- type Client
- type MockClient
- type ScheduledTaskConfigProvider
- type TaskHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLoadingDatabaseHost = errors.New("error loading task queue host") ErrMTLSRedisClientOpt = errors.New("error redis client opt") ErrSecretTypeQueue = errors.New("unsupported secret type for task queue") ErrACLNotEnabled = errors.New("ACL is not enabled for task queue") ErrACLPassword = errors.New("ACL is not load password for redis client") ErrACLUsername = errors.New("ACL is not load username for redis client") )
View Source
var ( ErrEnqueueingTask = errors.New("enqueue task") ErrClientShutdown = errors.New("client shutdown") ErrStartingWorker = errors.New("starting worker") ErrCreatingScheduler = errors.New("creating scheduler") ErrRunningScheduler = errors.New("running scheduler") ErrReadingConfig = errors.New("error reading scheduler task config file") ErrInvalidConfig = errors.New("invalid scheduler task config") )
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) Enqueue ¶
func (a *App) Enqueue( ctx context.Context, task *asynq.Task, opts ...asynq.Option, ) (*asynq.TaskInfo, error)
Enqueue is used to run tasks
func (*App) RegisterTasks ¶
func (a *App) RegisterTasks(ctx context.Context, handlers []TaskHandler)
RegisterTasks registers multiple task handlers
func (*App) RunScheduler ¶
RunScheduler starts the cron job scheduling It starts the cron related tasks defined in the schedulerTasksConfig
type MockClient ¶
MockClient implements the AsyncClient interface for testing
func (*MockClient) Close ¶
func (m *MockClient) Close() error
func (*MockClient) EnqueueContext ¶
func (*MockClient) Ping ¶
func (m *MockClient) Ping() error
type ScheduledTaskConfigProvider ¶
ScheduledTaskConfigProvider implements asynq PeriodicTaskConfigProvider interface.
func (*ScheduledTaskConfigProvider) GetConfigs ¶
func (p *ScheduledTaskConfigProvider) GetConfigs() ([]*asynq.PeriodicTaskConfig, error)
GetConfigs Parses the yaml file and return a list of PeriodicTaskConfigs.
Click to show internal directories.
Click to hide internal directories.