engine

package
v0.0.0-...-70b4a1e Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 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 Callback

type Callback interface {
	Send(r io.Reader) (err error)
}

type Engine

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

func New

func New() (engine *Engine)

func (*Engine) Done

func (e *Engine) Done() <-chan struct{}

func (*Engine) JobAdd

func (e *Engine) JobAdd(queue string, task Task, callback Callback) (err error)

JobAdd adds a task to queue. When the task done, its result will be sent.

func (*Engine) QueueAdd

func (e *Engine) QueueAdd(name string, opts *QueueOpts) (err error)

QueueAdd creates a queue in engine with specified name and opts.

func (*Engine) QueueList

func (e *Engine) QueueList()

func (*Engine) Shutdown

func (e *Engine) Shutdown()

Shutdown notify all executors to shutdown.

type QueueOpts

type QueueOpts struct {
	// Consumer count.
	CoreSize int
}

Queue options.

type Task

type Task interface {
	Run(ctx context.Context, cb Callback) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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