Documentation
¶
Index ¶
- type BackgroundTask
- func (t *BackgroundTask) GetName() string
- func (t *BackgroundTask) GetSeverity() background.ProcessSeverity
- func (t *BackgroundTask) IsPendingToShutdown() bool
- func (t *BackgroundTask) IsProcessingJob() bool
- func (t *BackgroundTask) OnStart(ctx context.Context) error
- func (t *BackgroundTask) OnStop(ctx context.Context) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackgroundTask ¶
type BackgroundTask struct {
// contains filtered or unexported fields
}
BackgroundTask a process that works in configured iteration to execute job handling in the background
func NewBackgroundTask ¶
func NewBackgroundTask(TaskName string, GracefulShutdownCallback func(), opts ...Option) *BackgroundTask
NewBackgroundTask a new instance
func (*BackgroundTask) GetSeverity ¶
func (t *BackgroundTask) GetSeverity() background.ProcessSeverity
GetSeverity of the task
func (*BackgroundTask) IsPendingToShutdown ¶
func (t *BackgroundTask) IsPendingToShutdown() bool
IsPendingToShutdown a worker
func (*BackgroundTask) IsProcessingJob ¶
func (t *BackgroundTask) IsProcessingJob() bool
IsProcessingJob in worker cycle handling
type Option ¶
type Option func(c *BackgroundTask)
Option for task execution, timeouts, handler, tick interval etc.
func SetExecInterval ¶
SetExecInterval how often task must be executed
func SetHandler ¶
SetHandler of the task (logic that will be performed)
func SetProcessingTimeout ¶
SetProcessingTimeout for task handling
func SetSeverity ¶
func SetSeverity(s background.ProcessSeverity) Option
SetSeverity of how important for the application to run this task
Click to show internal directories.
Click to hide internal directories.