queue

package
v0.0.0-...-00e0705 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handlers

func Handlers() map[string]string

Handlers handlers info

func Register

func Register(n string, h HandlerFunc)

Register register handler

Types

type HandlerFunc

type HandlerFunc func(id string, body []byte) error

HandlerFunc task handler func

func Get

func Get(n string) (HandlerFunc, bool)

Get get handler by name

type Queue

type Queue interface {
	Put(*Task) error
	Launch(name string) error
}

Queue message queue

type Task

type Task struct {
	ID       string    `json:"id"`
	Type     string    `json:"type"`
	Body     []byte    `json:"body"`
	Priority uint8     `json:"priority"`
	Created  time.Time `json:"created"`
}

Task task model

func NewTask

func NewTask(t string, p uint8, b []byte) *Task

NewTask create task

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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