Created
November 22, 2011 14:46
-
-
Save alister/1385819 to your computer and use it in GitHub Desktop.
Pheanstalkd_putTask
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 | |
function putTask( | |
$data, | |
$priority, | |
$delay = 0, | |
$tube = 'default', | |
$canIgnore = false | |
) { | |
$taskInfo = array('task' => $data, | |
'_queuedAt' => time(), | |
'_ignorable'=> $canIgnore, | |
); | |
$json = json_encode($taskInfo); | |
$this->pheanstalk | |
->useTube($tube) | |
->put($json, $priority, $delay, self::DEFAULT_TTR); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment