Skip to content

Instantly share code, notes, and snippets.

@icambridge
Created February 5, 2012 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icambridge/1744843 to your computer and use it in GitHub Desktop.
Save icambridge/1744843 to your computer and use it in GitHub Desktop.
Basic Worker
<?php
define('NET_GEARMAN_JOB_PATH', __DIR__);
require_once ('Net/Gearman/Worker.php');
try
{
print("[Gearman] starting worker...");
$worker = new Net_Gearman_Worker(array('127.0.0.1:4730'));
$worker->addAbility('Example');
$worker->beginWork();
}
catch (Net_Gearman_Exception $e)
{
print("[German] exception caught: " . $e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment