Skip to content

Instantly share code, notes, and snippets.

@alister
Created November 22, 2011 14:46
Show Gist options
  • Save alister/1385819 to your computer and use it in GitHub Desktop.
Save alister/1385819 to your computer and use it in GitHub Desktop.
Pheanstalkd_putTask
<?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