core: Index | Files

package worker

import ""

Package worker provides background worker tasks.


Package Files


type Worker Uses

type Worker struct {
    // contains filtered or unexported fields

Worker is a set of managed background go routines.

func (*Worker) Go Uses

func (w *Worker) Go(fn func())

Go excutes the function fn in a new Go routine. Multiple Go routines may be started under the same Worker. It is the function's responsibility to monitor the channel returned by `Worker.HaltCh()` and to return.

func (*Worker) Halt Uses

func (w *Worker) Halt()

Halt signals all Go routines started under a Worker to terminate, and waits till all go routines have returned.

func (*Worker) HaltCh Uses

func (w *Worker) HaltCh() <-chan interface{}

HaltCh returns the channel that will be closed on a call to Halt.

Package worker imports 1 packages (graph) and is imported by 22 packages. Updated 2019-09-06. Refresh now. Tools for package owners.