Last active
March 2, 2016 10:24
-
-
Save shaunlee/b946f8c7e2647d8df023 to your computer and use it in GitHub Desktop.
beanstalkd: clear tube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'pheanstalk/pheanstalk_init.php'; | |
$ph = new Pheanstalk_Pheanstalk('127.0.0.1'); | |
$ph->ignore('default')->watch($tube); | |
while ($job = $ph->reserve(0)) { | |
$ph->delete($job); | |
fwrite(STDOUT, $job->getId() . "\r"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment