core: github.com/katzenpost/core/worker Index | Files

package worker

import "github.com/katzenpost/core/worker"

Package worker provides background worker tasks.

Index

Package Files

worker.go

type Worker Uses

type Worker struct {
    sync.WaitGroup
    // 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 responsiblity 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 21 packages. Updated 2017-12-12. Refresh now. Tools for package owners.