jobber

package
v0.0.0-...-28b3ec9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(args []byte) error

Handler job handler

type Jobber

type Jobber interface {
	Push(queue string, args interface{}) error
	Register(queue string, handler Handler)
	Start() error
}

Jobber background job

type RedisJobber

type RedisJobber struct {
	Redis  *redis.Pool     `inject:""`
	Logger *logging.Logger `inject:""`

	Timeout  int
	Handlers map[string]Handler
}

RedisJobber job by readis store

func (*RedisJobber) Push

func (p *RedisJobber) Push(queue string, args interface{}) error

Push add a job task

func (*RedisJobber) Register

func (p *RedisJobber) Register(queue string, handler Handler)

Register register a job-handler

func (*RedisJobber) Start

func (p *RedisJobber) Start() error

Start start to process job

Jump to

Keyboard shortcuts

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