workers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const WorkerContextKey = ContextKey("WorkerContext")

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey string

type Controller

type Controller interface {
	Run() error
	Stop()
}

func NewController

func NewController(ctx context.Context, trigger triggers.Trigger, router Router,
	options ControllerOptions) Controller

type ControllerOptions

type ControllerOptions struct {
	NumOfWorker int
}

type Handler

type Handler func(ctx context.Context, task tasks.Task) error

type Router

type Router interface {
	Register(taskType string, handler Handler)
	Resolve(taskType string) (Handler, bool)
}

func NewRouter

func NewRouter() Router

type WorkerContext

type WorkerContext struct {
	ID string
}

Jump to

Keyboard shortcuts

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