The following code is a snipet taken from an example of pheanstalk being implemented and working properly (obtained from pheanstalk\'s github page: https://github.com/pda/ph
$pheanstalk->useTube('testtube')->put("job payload goes here\n");
is equivalent to:
$temp = $pheanstalk->useTube('testtube');
$temp->put("job payload goes here\n");
So first it calls useTube()
to specify which tube the payload should be put into, then it puts the payload into that. It's depending on the fact that methods that perform actions return the Pheanstalk
object they were called on, so it's also short for:
$pheanstalk->useTube('testtube');
$pheanstalk->put("job payload goes here\n");
ignore(tubename)
removes that tube from the watchlist. The default
tube is watched by default, so this disables that and just waits for messages in the testtube
tube.
It's doing exactly what the comment above it says: Checking that the server is available. You could use this in your producer code to report an error before trying to send to a beanstalk server that's not listening.