queue

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: BSD-2-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Workers int
	Delay   time.Duration
}

func NewConfig

func NewConfig() *Config

func (*Config) Load

func (c *Config) Load(configReporter config.Reporter) error

func (*Config) Validate

func (c *Config) Validate() error

type Queue

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

func New

func New(cfg *Config, lgr log.Logger, str store.Store) (*Queue, error)

func (*Queue) RegisterRunner

func (q *Queue) RegisterRunner(runner Runner) error

func (*Queue) Start

func (q *Queue) Start()

func (*Queue) Stop

func (q *Queue) Stop()

type Runner

type Runner interface {
	CanRunTask(tks *task.Task) bool

	Run(ctx context.Context, tsk *task.Task)
}

Jump to

Keyboard shortcuts

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