Documentation
¶
Index ¶
- Variables
- func GetGroup() *group
- type Condition
- type Job
- type LoopConfig
- type Operation
- type Pool
- type Routine
- func (rm *Routine) Allow() bool
- func (rm *Routine) AllowAt(now time.Time) bool
- func (rm *Routine) Execute(ctx context.Context, fn func(ctx context.Context) error) error
- func (rm *Routine) ExecuteWithRetry(ctx context.Context, interval time.Duration, iterations int, ...) error
- func (rm *Routine) ForceClose()
- func (rm *Routine) ForceOpen()
- func (rm *Routine) ForceOpenAt(now time.Time)
- func (rm *Routine) GetResetTimeout() time.Duration
- func (rm *Routine) GetState() State
- func (rm *Routine) GetThreshold() int
- func (rm *Routine) Loop(ctx context.Context, interval time.Duration, triggerChan <-chan struct{}, ...)
- func (rm *Routine) MarkFailure()
- func (rm *Routine) MarkFailureAt(now time.Time)
- func (rm *Routine) MarkSuccess()
- func (rm *Routine) WouldAllowAt(now time.Time) bool
- type RunResult
- type Runner
- func (r *Runner) Run(ctx context.Context) (*RunResult, error)
- func (r *Runner) Running() bool
- func (r *Runner) StartSchedule(ctx context.Context, sched Schedule)
- func (r *Runner) SubscribeMessenger(ctx context.Context, bus libbus.Messenger, subject string) (libbus.Subscription, error)
- func (r *Runner) Trigger(ctx context.Context)
- type RunnerOption
- type Schedule
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyRunning = errors.New("libroutine: job is already running")
View Source
var ErrCircuitOpen = errors.New("circuit breaker is open")
Functions ¶
Types ¶
type LoopConfig ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) MarkSuccess ¶
type Routine ¶
type Routine struct {
// contains filtered or unexported fields
}
func (*Routine) ExecuteWithRetry ¶
func (*Routine) ForceClose ¶
func (rm *Routine) ForceClose()
func (*Routine) ForceOpenAt ¶
func (*Routine) GetResetTimeout ¶
func (*Routine) GetThreshold ¶
func (*Routine) MarkFailure ¶
func (rm *Routine) MarkFailure()
func (*Routine) MarkFailureAt ¶
func (*Routine) MarkSuccess ¶
func (rm *Routine) MarkSuccess()
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) SubscribeMessenger ¶
type RunnerOption ¶
type RunnerOption func(*Runner)
func WithResultHook ¶
func WithResultHook(fn func(*RunResult)) RunnerOption
func WithTracker ¶
func WithTracker(tracker libtracker.ActivityTracker) RunnerOption
Click to show internal directories.
Click to hide internal directories.