Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncTask ¶
type AsyncTask struct {
// contains filtered or unexported fields
}
AsyncTask is a struct that wraps tasks that should run periodically and can be remotely stopped & started, as well as making it's status (running/stopped) available.
func NewAsyncTask ¶
func NewAsyncTask( name string, task func(l logging.LoggerInterface) error, period int, onInit func(l logging.LoggerInterface) error, onStop func(l logging.LoggerInterface), logger logging.LoggerInterface, ) *AsyncTask
NewAsyncTask creates a new task and returns a pointer to it
func (*AsyncTask) Start ¶
func (t *AsyncTask) Start()
Start initiates the task. It wraps the execution in a closure guarded by a call to recover() in order to prevent the main application from crashin if something goes wrong while the sdk interacts with the backend.
Click to show internal directories.
Click to hide internal directories.