Slide 19
Slide 19 text
#psm14
/**
* Put stuff in the queue
*/
function pushhub_notify($nids, $topic='shared.xml', $timeout=60){
$hub_url = variable_get('pushhub_huburl', 'http://example.com/hub');
Resque::setBackend('localhost:6379');
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$topic_url = url("pushhub/" . $topic, array('absolute' => TRUE));
$payload = array('hub.mode' => 'publish',
'hub.url' => $topic_url);
$hub_endpoint = $hub_url . "/publish";
# Add the job to the queue
Resque::enqueue('default', 'Post', array($hub_endpoint, $payload,
$headers, $timeout));
}