redis

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngine

func NewEngine(redisClient *redis.Client) async.Engine

NewEngine returns a new Redis-based implementation of the aync.Engine interface

Types

type Cleaner

type Cleaner interface {
	// Run causes the cleaner to clean up after dead worker. It blocks until a
	// fatal error is encountered or the context passed to it has been canceled.
	// Run always returns a non-nil error.
	Run(context.Context) error
}

Cleaner is an interface to be implemented by components that re-queue tasks assigned to dead workers

type Heart

type Heart interface {
	// Beat sends a single heartbeat
	Beat() error
	// Run sends heartbeats at regular intervals.  It blocks until a fatal error
	// is encountered or the context passed to it has been canceled. Run always
	// returns a non-nil error.
	Run(context.Context) error
}

Heart is an interface to be implemented by components that can send worker heartbeats

type Worker

type Worker interface {
	// GetID returns the worker's ID
	GetID() string
	// RegisterJob registers a new Job with the worker
	RegisterJob(name string, fn async.JobFn) error
	// Run causes the worker to complete tasks. It blocks until a fatal error is
	// encountered or the context passed to it has been canceled. Run always
	// returns a non-nil error.
	Run(context.Context) error
}

Worker is an interface to be implemented by components that receive and asynchronously complete provisioning and deprovisioning tasks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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