Documentation
¶
Index ¶
- Constants
- Variables
- func WithTimeout(timeout time.Duration) taskOption
- type Context
- func (c *Context) CurrentTick() time.Time
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) LastTick() time.Time
- func (c *Context) Logger() Logger
- func (c *Context) TaskName() string
- func (c *Context) Value(key any) any
- type Dispatcher
- type Engine
- func (e *Engine) RegisterTask(task *Task, policy workerPolicy, trigger Trigger, catchUpEnabled bool, ...) error
- func (e *Engine) RemoveTask(name string) error
- func (e *Engine) Run() error
- func (e *Engine) Shutdown() error
- func (e *Engine) ShutdownTask(name string) error
- func (e *Engine) Start()
- func (e *Engine) StartTask(name string) error
- type EngineOption
- type Job
- type Logger
- type LoggerFactory
- type Scheduler
- type Task
- type Tick
- type Trigger
- type Worker
- type WorkerSupervisor
- func (ws *WorkerSupervisor) PauseScheduler()
- func (ws *WorkerSupervisor) ResumeScheduler()
- func (ws *WorkerSupervisor) SchedulerStatus() schedulerState
- func (ws *WorkerSupervisor) Shutdown()
- func (ws *WorkerSupervisor) Start(ctx context.Context)
- func (ws *WorkerSupervisor) WorkerStatus() workerState
Constants ¶
View Source
const ( WorkerPolicyParallel workerPolicy = iota WorkerPolicySerial WorkerPolicySkipIfBusy )
View Source
const ContextKey contextKey = "go-taskengine/contextKey"
Variables ¶
Functions ¶
func WithTimeout ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) CurrentTick ¶
type Dispatcher ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) RegisterTask ¶
func (*Engine) RemoveTask ¶
func (*Engine) ShutdownTask ¶
type EngineOption ¶
type EngineOption func(*Engine)
func WithLoggerFactory ¶
func WithLoggerFactory(factory LoggerFactory) EngineOption
func WithShutdownTimeout ¶
func WithShutdownTimeout(timeout time.Duration) EngineOption
type Logger ¶
type Logger interface {
Info(msg string)
Infof(format string, args ...any)
Warn(msg string)
Warnf(format string, args ...any)
Error(msg string)
Errorf(format string, args ...any)
}
func DefaultLoggerFactory ¶
type LoggerFactory ¶
type WorkerSupervisor ¶
type WorkerSupervisor struct {
// contains filtered or unexported fields
}
func (*WorkerSupervisor) PauseScheduler ¶
func (ws *WorkerSupervisor) PauseScheduler()
func (*WorkerSupervisor) ResumeScheduler ¶
func (ws *WorkerSupervisor) ResumeScheduler()
func (*WorkerSupervisor) SchedulerStatus ¶
func (ws *WorkerSupervisor) SchedulerStatus() schedulerState
func (*WorkerSupervisor) Shutdown ¶
func (ws *WorkerSupervisor) Shutdown()
func (*WorkerSupervisor) Start ¶
func (ws *WorkerSupervisor) Start(ctx context.Context)
func (*WorkerSupervisor) WorkerStatus ¶
func (ws *WorkerSupervisor) WorkerStatus() workerState
Source Files
¶
Click to show internal directories.
Click to hide internal directories.