Job

This class models a Beanstalkd job. At it's lowest level a Job is really just a collection of bytes but this function provides some addition functionality for interacting with jobs.

Constructors

this
this()

Default constructor for the Job class.

this
this(T[] data)

Constructor for the Job class that allows it to handle strings of any type.

Members

Functions

append
void append(T[] data)

This function appends a string (or wstring or dstring) to the data stored within a Job.

bodyAsDString
dstring bodyAsDString()

Fetches the body of the job, converting it to a dstring in the process.

bodyAsString
string bodyAsString()

Fetches the body of the job, converting it to a string in the process.

bodyAsWString
wstring bodyAsWString()

Fetches the body of the job, converting it to a wstring in the process.

bury
void bury(uint priority)

This function buries a job on Beanstalk. Note that only reserved jobs can be buried.

destroy
void destroy()

This function deletes a job from Beanstalk. Note that this function can only be called on Jobs that have a been put into or reserved out of a Beanstalk server.

release
void release(uint delay, uint priority)

This function releases a job back to Beanstalk. Note that only reserved jobs can be released.

touch
void touch()

This function touchs a job on Beanstalk, extending its time to run. Note that only reserved jobs can be touched.

write
void write(ubyte[] data)

This function appends an array of ubytes to the data stored within a Job object.

Properties

data
ubyte[] data [@property getter]

This function provides package level access to the data associated with a Job object.

id
uint id [@property getter]

Getter for the job id property. Note that this property will only be valid for jobs that have been added to Beanstalk or extract from Beanstalk. If called on a Job that doesn't meet these criteria an exception will be thrown.

id
uint id [@property setter]

Setter for the job id property (visible only in package).

tube
Tube tube [@property getter]

This function returns the Tube that a job was either put on or reserved from. If the Job hasn't been put, reserved or peeked then this will be null.

tube
Tube tube [@property setter]

Tube property setter, only accessible within the package.

Static variables

DEFAULT_DELAY
auto DEFAULT_DELAY;

The default delay applied to jobs.

DEFAULT_PRIORITY
auto DEFAULT_PRIORITY;

The default priority given to jobs.

DEFAULT_TIME_TO_RUN
auto DEFAULT_TIME_TO_RUN;

The default time to run applied to jobs.

Meta