queue

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pool *ants.Pool

Pool defines the default queue pool

Functions

func Dispatch

func Dispatch(handler func()) error

Dispatch runs the handler in a goroutine

func NewPool

func NewPool(number int)

NewPool creates the default queue pool

Types

type Job

type Job struct {
	Handler     func()
	ShouldQueue bool
}

newJob(...).dispatch()

func NewJob

func NewJob(handler func()) *Job

NewJob creates a new Job struct

func (*Job) Dispatch

func (j *Job) Dispatch() error

Dispatch runs the handler in the queue or synchronously

func (*Job) Queue

func (j *Job) Queue(shouldQueue bool) *Job

Queue tells the job to run on a goroutine or not.

Jump to

Keyboard shortcuts

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