worker

package
v0.0.0-...-88f351d Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT, CC-BY-4.0, MIT, + 1 more Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PollTime      = 2 * time.Second
	StatsInterval = 10 * time.Second
	StealChance   = 0.25
)

Variables

This section is empty.

Functions

func Loop

func Loop(ctx scope.Context, heim *proto.Heim, workerName, queueName string) error

func Serve

func Serve(ctx scope.Context, addr string)

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(ctx scope.Context, heim *proto.Heim, workerName, queueName string) (*Controller, error)

type EmailWorker

type EmailWorker struct {
	// contains filtered or unexported fields
}

func (*EmailWorker) Init

func (w *EmailWorker) Init(heim *proto.Heim) error

func (EmailWorker) JobType

func (EmailWorker) JobType() jobs.JobType

func (EmailWorker) QueueName

func (EmailWorker) QueueName() string

func (*EmailWorker) Work

func (w *EmailWorker) Work(ctx scope.Context, job *jobs.Job, payload interface{}) error

type Worker

type Worker interface {
	Init(heim *proto.Heim) error
	QueueName() string
	JobType() jobs.JobType
	Work(ctx scope.Context, job *jobs.Job, payload interface{}) error
}

Jump to

Keyboard shortcuts

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