routine

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRecurringTaskHandler

type IRecurringTaskHandler interface {
	// Do is called on constant interval
	Do()
}

IRecurringTaskHandler is the interface to implement the recurring task business logic

type ITimeoutTaskHandler

type ITimeoutTaskHandler interface {
	// Do is called on constant interval
	Do()
}

ITimeoutTaskHandler is the interface to implement the timeout task business logic

type RecurringTask

type RecurringTask struct {
	service.AbstractService
	H        IRecurringTaskHandler
	Interval time.Duration
	// contains filtered or unexported fields
}

RecurringTask represents a recurring task

func NewRecurringTask

func NewRecurringTask(h IRecurringTaskHandler, i time.Duration) *RecurringTask

NewRecurringTask creates an instance of RecurringTask

func (*RecurringTask) Start

func (t *RecurringTask) Start() error

Start starts the timer

func (*RecurringTask) Stop

func (t *RecurringTask) Stop() error

Stop stops the timer

type TimeoutTask

type TimeoutTask struct {
	service.AbstractService
	H        ITimeoutTaskHandler
	Duration time.Duration
	// contains filtered or unexported fields
}

TimeoutTask represents a timeout task

func NewTimeoutTask

func NewTimeoutTask(h ITimeoutTaskHandler, d time.Duration) *TimeoutTask

NewTimeoutTask creates an instance of TimeoutTask

func (*TimeoutTask) Start

func (t *TimeoutTask) Start() error

Start starts the timeout

func (*TimeoutTask) Stop

func (t *TimeoutTask) Stop() error

Stop stops the timeout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL