worker

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

func NewWorker(workerCfg Config)

NewWorker creates a new worker instance to listen and process jobs in the queue.

Types

type Config

type Config struct {
	Host        string
	Port        int
	Namespace   string
	JobName     string
	Concurrency uint
}

Config defines configuration for creating a NewWorker.

type Context

type Context struct {
	GUID        string
	Preset      string
	Source      string
	Destination string
}

Context defines the job context to be passed to the worker.

func (*Context) FindJob

func (c *Context) FindJob(job *work.Job, next work.NextMiddlewareFunc) error

FindJob worker middleware for setting job context from job arguments.

func (*Context) Log

func (c *Context) Log(job *work.Job, next work.NextMiddlewareFunc) error

Log worker middleware for logging job.

func (*Context) SendJob

func (c *Context) SendJob(job *work.Job) error

SendJob worker handler for running job.

Jump to

Keyboard shortcuts

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