gostalk

package module
v0.0.0-...-a9e9a01 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReaderSize = 65535

Functions

This section is empty.

Types

type Gostalk

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

func Connect

func Connect(addr string) (this *Gostalk, err error)

Returns a new beanstalkd tcp connection and sets up a new buffered reader

func (*Gostalk) Bury

func (this *Gostalk) Bury(jobId uint64, priority uint32) (err error)

Bury a job by it's id

func (*Gostalk) Delete

func (this *Gostalk) Delete(jobId uint64) (err error)

Delete a job by it's id

func (*Gostalk) Disconnect

func (this *Gostalk) Disconnect() (err error)

Disconnects from the beanstalkd server

func (*Gostalk) Ignore

func (this *Gostalk) Ignore(tubeName string) (int, error)

Ignores the specified tube and returns the number of tubes being watched. Cannot ignore a tube if it's the only tube being watched

func (*Gostalk) Put

func (this *Gostalk) Put(data []byte, priority uint32, delay time.Duration, ttr time.Duration) (uint64, error)

Put is is for any process that wants to insert a job into the queue. It takes the data, priority, delay, time to release

func (*Gostalk) Reserve

func (this *Gostalk) Reserve() (*Job, error)

Reserve waits for a job indefinitely from the server. Once the job has been received, it returns the job This is a blocking call.

func (*Gostalk) ReserveWithTimeout

func (this *Gostalk) ReserveWithTimeout(duration time.Duration) (*Job, error)

func (*Gostalk) Use

func (this *Gostalk) Use(tubeName string) (err error)

Use specifies the tube to use. If the tube does not exist, it will be created.

func (*Gostalk) Watch

func (this *Gostalk) Watch(tubeName string) (int, error)

Sends the watch command to beanstalkd and returns the number of tubes being watched

type Job

type Job struct {
	Id   uint64
	Body []byte
}

Directories

Path Synopsis
ex

Jump to

Keyboard shortcuts

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