queue

package
v0.0.0-...-09d934d Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConnection = errors.New("Disque Error: no client nor connection is provided!")

ErrNoConnection is the error thrown when no connection options are provided

View Source
var FetchTimeout = "10s"

FetchTimeout is the default fetch timeout

View Source
var JobTimeout = "5s"

JobTimeout is the default job timeout

Functions

func AckJob

func AckJob(client *disque.DisquePool, id string) (err error)

AckJob sends an ACK about a job to the queue

func NackJob

func NackJob(client *disque.DisquePool, id string) (err error)

NackJob sends an NACK about a job to the queue

func RemoveJob

func RemoveJob(client *disque.DisquePool, id string) (err error)

RemoveJob removes a job from the queue using the id

Types

type Data

type Data struct {
	Body      string
	ETA       time.Time
	CreatedAt time.Time
	UpdatedAt time.Time
}

Data is a wrapper struct for the job's data

type Job

type Job struct {
	ID        string
	QueueName string
	Body      string
	ETA       time.Time
	CreatedAt time.Time
	UpdatedAt time.Time
	Raw       *disque.JobDetails
}

Job is the job struct

func AddJob

func AddJob(client *disque.DisquePool, queueName string, body string, ETA time.Time, options *map[string]string) (job *Job, err error)

AddJob adds a job to the queue

func FetchJobs

func FetchJobs(client *disque.DisquePool, queueName string, n int) (jobs []*Job, err error)

FetchJobs gets jobs from the queue that are due for processing

func GetJob

func GetJob(client *disque.DisquePool, id string) (job *Job, err error)

GetJob gets a job from the queue using the id

Jump to

Keyboard shortcuts

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