istio: Index | Files

package util

import ""


Package Files


type Worker Uses

type Worker struct {
    // contains filtered or unexported fields

Worker is a utility to help manage the lifecycle of a worker thread.

func NewWorker Uses

func NewWorker(name string, scope *log.Scope) *Worker

NewWorker creates a new worker with the given name and logging scope.

func (*Worker) Start Uses

func (w *Worker) Start(setupFn func() error, runFn func(c context.Context)) error

Start the worker thread via the provided lambda. The runFn lambda is run in a go routine and is provided a context to trigger the exit of the function. If this Worker was already started, returns an error.

func (*Worker) Stop Uses

func (w *Worker) Stop()

Stop the worker thread and waits for it to exit gracefully.

Package util imports 4 packages (graph) and is imported by 7 packages. Updated 2019-06-12. Refresh now. Tools for package owners.