Documentation
¶
Index ¶
- Constants
- func New() *process
- func NewWithContext(wg *sync.WaitGroup, ctx context.Context, ctxCancel context.CancelFunc) *process
- type Worker
- func (w *Worker) DefaultEvent() *Worker
- func (w *Worker) Off(e event) *Worker
- func (w *Worker) On(e event, fn func(w *Worker, others ...interface{})) *Worker
- func (w *Worker) Run()
- func (w *Worker) RunInterval()
- func (w *Worker) SetFunc(fn func(g *Worker)) *Worker
- func (w *Worker) SetInterval(interval time.Duration)
Constants ¶
View Source
const ( Signal = "signal" Exit = "exit" Error = "error" )
Variables ¶
This section is empty.
Functions ¶
func NewWithContext ¶
Types ¶
type Worker ¶
type Worker struct { Name string StopCtx context.Context WG *sync.WaitGroup Fn func(w *Worker) Interval time.Duration // contains filtered or unexported fields }
func (*Worker) DefaultEvent ¶
func (*Worker) RunInterval ¶
func (w *Worker) RunInterval()
func (*Worker) SetInterval ¶
Click to show internal directories.
Click to hide internal directories.