fake

package
v0.9.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	SubmittedTasks map[string]async.Task
	RunBehavior    RunFn
}

Engine is a fake implementation of async.Engine used for testing

func NewEngine

func NewEngine() *Engine

NewEngine returns a new, fake implementation of async.Engine used for testing

func (*Engine) RegisterJob

func (e *Engine) RegisterJob(name string, fn async.JobFn) error

RegisterJob registers a new Job with the async engine

func (*Engine) Run added in v0.10.0

func (e *Engine) Run(ctx context.Context) error

Run causes the async engine to carry out all of its functions. It blocks until a fatal error is encountered or the context passed to it has been canceled. Run always returns a non-nil error.

func (*Engine) SubmitTask

func (e *Engine) SubmitTask(task async.Task) error

SubmitTask submits an idempotent task to the async engine for reliable, asynchronous completion

type RunFn added in v0.10.0

type RunFn func(context.Context) error

RunFn describes a function used to provide pluggable runtime behavior to the fake async engine

Jump to

Keyboard shortcuts

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