Documentation ¶
Overview ¶
Client library for the beanstalkd protocol. See http://kr.github.com/beanstalkd/
We are lenient about the protocol -- we accept either CR LF or just LF to terminate server replies. We also trim white space around words in reply lines.
This package is synchronized internally. It is safe to call any of these functions from any goroutine at any time.
Note that, as of version 1.4.4, beanstalkd provides only 1-second granularity on all duration values.
Index ¶
- Constants
- Variables
- type Conn
- type Error
- type Job
- type Tube
- func (t Tube) Kick(n uint64) (uint64, os.Error)
- func (t Tube) Pause(µs uint64) os.Error
- func (t Tube) PeekBuried() (*Job, os.Error)
- func (t Tube) PeekDelayed() (*Job, os.Error)
- func (t Tube) PeekReady() (*Job, os.Error)
- func (t Tube) Put(body string, pri uint32, µsDelay, µsTTR uint64) (id uint64, err os.Error)
- func (t Tube) Stats() (map[string]string, os.Error)
- type TubeError
- type TubeSet
Constants ¶
const Forever = 4000000000000000 // µs
For use in parameters that measure duration (in microseconds). Not really infinite; merely large. About 126 years.
Variables ¶
var ( NameTooLong = os.NewError("name too long") IllegalChar = os.NewError("name contains illegal char") )
Reasons for an invalid tube name.
var ( OutOfMemory = os.NewError("Server Out of Memory") InternalError = os.NewError("Server Internal Error") Draining = os.NewError("Server Draining") Buried = os.NewError("Buried") JobTooBig = os.NewError("Job Too Big") TimedOut = os.NewError("Reserve Timed Out") NotFound = os.NewError("Job or Tube Not Found") NotIgnored = os.NewError("Tube Not Ignored") )
Error responses from the server.
var BadReply = os.NewError("Bad Reply from Server")
The server sent a bad reply. For example: unknown or inappropriate response, wrong number of terms, or invalid format.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
A connection to beanstalkd. Provides methods that operate outside of any tube. This type also embeds Tube and TubeSet, which is convenient if you rarely change tubes.
type Tube ¶
type Tube struct { Name string // contains filtered or unexported fields }
Represents a single tube. Provides methods that operate on one tube, especially Put.
func (Tube) PeekBuried ¶
Get a copy of a buried job in this tube, if any.
func (Tube) PeekDelayed ¶
Get a copy of the next delayed job in this tube, if any.
type TubeSet ¶
type TubeSet struct { Names []string // contains filtered or unexported fields }
Represents a set of tubes. Provides methods that operate on several tubes at once, especially Reserve.
func NewTubeSet ¶
Returns an error if any of the tube names are invalid.