dispatcher

package
v0.0.0-...-5f4265e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2015 License: Apache-2.0 Imports: 6 Imported by: 50

Documentation

Overview

Queue manager for executing jobs, handling deduplication of requests, and limiting the consumption of resources by a server. Allows callers to "join" an existing job and listen to the output provided by that job without reexecuting the actual task.

Provides Dispatcher, a reactor pattern implementation that processes jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	QueueFast         int
	QueueSlow         int
	Concurrent        int
	TrackDuplicateIds int
	// contains filtered or unexported fields
}

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(id jobs.RequestIdentifier, j jobs.Job, resp jobs.Response) (done <-chan bool, err error)

func (*Dispatcher) Start

func (d *Dispatcher) Start()

type Fast

type Fast interface {
	Fast() bool
}

type RequestIdentifierMap

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

func NewRequestIdentifierMap

func NewRequestIdentifierMap(size int) *RequestIdentifierMap

func (RequestIdentifierMap) Get

func (m RequestIdentifierMap) Get(id jobs.RequestIdentifier) interface{}

func (RequestIdentifierMap) Put

func (m RequestIdentifierMap) Put(id jobs.RequestIdentifier, v interface{}) (interface{}, bool)

Jump to

Keyboard shortcuts

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