worker

package
Version: v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 8 Imported by: 0

README

worker

Subpackage worker is a zmq-based backend worker queue service.

Documentation

Overview

Package worker a zmq backend worker queue

By taka@cmwang.net

Package worker a zmq backend worker queue

By taka@cmwang.net

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMarshal is the error when marshalling to JSON string failed.
	ErrMarshal = errors.New("Fail to marshal!")

	// ErrUnmarshal is the error when unmarshalling JSON string to structure failed.
	ErrUnmarshal = errors.New("Fail to unmarshal!")

	// ErrRequestNotSupport is the error when the request is not supported.
	ErrRequestNotSupport = errors.New("Request not support!")

	// ErrResponseNotSupport is the error when the response is not supported.
	ErrResponseNotSupport = errors.New("Response not support!")

	// ErrInvalidMessageLength is the error when the length of message is invalid.
	ErrInvalidMessageLength = errors.New("Invalid message length!")

	// ErrFailToGetFromMap is the error when retrieving item failed.
	ErrFailToGetFromMap = errors.New("Fail to retrieve item from map.")
)

Functions

func RequestHandler

func RequestHandler(ts int64, command, payload string, w http.ResponseWriter)

RequestHandler http request handler

func Start

func Start()

Start start service

func Stop

func Stop()

Stop stop service

Types

type Service

type Service struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Service service

func NewService

func NewService() (*Service, error)

NewService create service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL