NAME

AnyEvent::Beanstalk::Job - Class to represent a job from a beanstalkd server

VERSION

version 1.142520

SYNOPSIS

my $client = AnyEvent::Beanstalk->new;

my $job = $client->stats->recv;

print $job->data,"\n";

DESCRIPTION

All communication methods called by this class to the server will call recv on the condition variable returned by AnyEvent::Beanstalk. If this is undesired then a call can be made directly to the server via methods on the client.

Note however that beanstalkd processes command in sequence. So if there is currently a reserve request pending. Any calls to these methods will not return until the reserve command has returned so that beanstalkd can process any subsequent commands.

METHODS

id

Returns job id

client

Returns AnyEvent::Beanstalk object for the server the job resides on

buried

Returns true if the job is buried

reserved

Returns true if the job was created via a reserve command and has not been deleted, buried or released

data

Returns the raw data for the beanstalkd server for the job

error

Returns the last error

stats

Return a Stats object for this job. See AnyEvent::Beanstalk for a list of methods available.

delete

Tell the server to delete this job

touch

Calling touch on a reserved job will reset the time left for the job to complete back to the original ttr value.

peek

Peek this job on the server.

release

Release the job.

bury

Tell the server to bury the job

args

Decode and return the raw data from the beanstalkd server

tube

Return the name of the tube the job is in

ttr

Returns the jobs time to run, in seconds.

priority

Return the jobs priority

SEE ALSO

AnyEvent::Beanstalk, AnyEvent::Beanstalk::Stats

AUTHOR

Graham Barr <gbarr@pobox.com>

COPYRIGHT

Copyright (C) 2010 by Graham Barr.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.