async

package
v0.6.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cleaner

type Cleaner interface {
	Clean(context.Context) error
}

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

type Engine

type Engine interface {
	// RegisterJob registers a new Job with the async engine
	RegisterJob(name string, fn model.JobFunction) error
	// SubmitTask submits an idempotent task to the async engine for reliable,
	// asynchronous completion
	SubmitTask(model.Task) error
	// Start causes the async engine to begin executing queued tasks
	Start(context.Context) error
}

Engine is an interface for a broker-specifc framework for submitting and asynchronously completing provisioning and deprovisioning tasks.

func NewEngine

func NewEngine(redisClient *redis.Client) Engine

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

type Heart

type Heart interface {
	// Beat sends a single heartbeat
	Beat() error
	// Start sends heartbeats at regular intervals
	Start(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 model.JobFunction) error
	// Work causes the worker to begin completing tasks
	Work(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