jobque

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Queue     chan Payload
	MAX_QUEUE       = 1000
	MaxLength int64 = 5000
)
View Source
var (
	MaxWorker = os.Getenv("MAX_WORKERS")
	MaxQueue  = os.Getenv("MAX_QUEUE")
)
View Source
var JobQueue chan Job

Functions

func StartProcessor

func StartProcessor()

Types

type Dispatcher

type Dispatcher struct {
	WorkerPool chan chan Job
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher(maxWorkers int) *Dispatcher

func (*Dispatcher) Run

func (d *Dispatcher) Run()

func (*Dispatcher) Stop

func (d *Dispatcher) Stop()

type Job

type Job struct {
	Payload Payload
}

type Payload

type Payload struct {
	AllocRes func() error
}

func (*Payload) UploadToS3

func (p *Payload) UploadToS3() error

type PayloadCollection

type PayloadCollection struct {
	Version  string    `json:"version"`
	Token    string    `json:"token"`
	Payloads []Payload `json:"data"`
}

type Worker

type Worker struct {
	WorkerPool chan chan Job
	JobChannel chan Job
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(workerPool chan chan Job) Worker

func (Worker) Start

func (w Worker) Start()

func (Worker) Stop

func (w Worker) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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