View Source

<ac:macro ac:name="info"><ac:parameter ac:name="title">Zend_Gearman</ac:parameter></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Gearman
{zone-data}

{zone-data:proposer-list}
[Mike Willbanks|mailto:mike@digitalstruct.com]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 15 June 2011: Initial Draft.
{zone-data}

{zone-data:overview}
Zend\Gearman is a component for interfacing with the Gearman server. The functionality allows for different adapters (PECL: Gearman, PEAR: Net_Gearman and a Mock class for unit testing) to interface as a client and a worker.
{zone-data}

{zone-data:references}
* [PECL Gearman|http://pecl.php.net/package/gearman]
* [PEAR Net_Gearman (Github)|https://github.com/brianlmoon/net_gearman]
* [Initial ZF 1 Version|https://github.com/mwillbanks/Zend_Gearman]
{zone-data}

{zone-data:requirements}
Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

* This component *will* include an abstract factory for client and workers.
* This component *will only* interface with existing client / workers (PECL, PEAR) and a new one Mock.
* This component *will* utilize a new directory called "workers" inside of application and modules.
* This component *will* attempt to mimic or create similar behaviors between adapters
* This component *will not* handle process monitoring.
* This component *will* make use of a new bootstrap resource and application.ini configuration.
* This component *will* support usage of multiple serialization techniques (json, php) for workloads.
{zone-data}

{zone-data:dependencies}
Zend\Application - for initializing and bootstrapping "workers" directory.
Zend\Controller\Router - for routing the request if using the "workers" directory.
{zone-data}

{zone-data:operation}
The component will provide a unified interface to utilizing Gearman, it will also make use of bootstrapping to utilize existing resources.
{zone-data}

{zone-data:milestones}
* Milestone 1: Finish proposal and architectural description.
* Milestone 2: Working prototype, excluding dependencies on ZF2 MVC.
* Milestone 3: Unit tests exist, work, and are checked into github.
* Milestone 4: Working prototype updated for dependencies on ZF2 MVC.
* Milestone 5: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend\Gearman
* Zend\Gearman\Task
* Zend\Gearman\Client
* Zend\Gearman\Client\Pecl
* Zend\Gearman\Client\Pear
* Zend\Gearman\Client\Mock
* Zend\Gearman\Worker
* Zend\Gearman\Worker\Pecl
* Zend\Gearman\Worker\Pear
* Zend\Gearman\Worker\Mock
{zone-data}

{zone-data:use-cases}
||UC-01||
Submitting a Gearman Task to Gearman

{code}
$task = new \Zend\Gearman\Task()->setFunction('doStuff')
->setWorkload('something')
->setTaskType(Task::DO_NORMAL_BACKGROUND);

$client = \Zend\Gearman\Client::factory('pecl');
$client->addServer('127.0.0.1', 4730);
$client->runTask($task);
{code}

{zone-data}

{zone-data:skeletons}
{code}
// will be filled in later today
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>