Thanks, Keith. The sanity check seemed to work. Here's a copy/paste
from my shell:
$ telnet localhost 11300
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
put 0 0 0 1
a
INSERTED 1
reserve
RESERVED 1 1
a
delete 1
DELETED
^]
telnet> quit
Connection closed.
I tried running one of my scripts after doing telnet without
restarting beanstalkd. I'll list the code a little lower, but here's
the output:
$ php beanstalk_play.php
connect
set tube
enqueue
reserve
At that point, the script just hangs indefinitely. Here's the source
code of the script that I'm running:
<?
require_once('BeanStalk.class.php');
function ln($msg) {
echo $msg, "\n";
}
ln('connect');
$beanstalk = BeanStalk::open(array(
'servers' => array('127.0.0.1:11300'),
'select' => 'random peek',
'auto_unyaml' => false
));
ln('set tube');
$beanstalk->use_tube('test');
ln('enqueue');
$beanstalk->put(0, 0, 10, 'test');
ln('reserve');
$job = $beanstalk->reserve();
//$job = $beanstalk->reserve_with_timeout(1);
if ($job) {
ln('payload: ' . $job->get());
ln('delete');
$job->delete();
}
else {
ln('TIMEOUT');
}
ln('done');
I hit Ctrl-C to kill the script. Then, I did the telnet sanity check
again:
$ telnet localhost 11300
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
put 0 0 0 1
a
INSERTED 6
reserve
RESERVED 6 1
a
delete 6
DELETED
^]
telnet> quit
Connection closed.
... am I going crazy?
On Apr 6, 2:31 pm, Keith Rarick <[email protected]> wrote:
> On Tue, Apr 6, 2010 at 1:23 PM, Daniel Wong <[email protected]> wrote:
> > I'm just getting started with beanstalk. I believe my server is
> > working, but when I try to reserve jobs, execution just blocks.
>
> You can use telnet to do a sanity check. Start up a fresh server, then try
> this:
>
> $ telnet localhost 11300
> put 0 0 0 1
> a
> INSERTED 1
> reserve
> RESERVED 1 1
> a
> delete 1
> DELETED
>
> kr
--
You received this message because you are subscribed to the Google Groups
"beanstalk-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/beanstalk-talk?hl=en.