note 117673 added to gearmanjob.construct

From: Date: Sun, 19 Jul 2015 20:35:02 +0000
Subject: note 117673 added to gearmanjob.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-203139@lists.php.net to get a copy of this message
Usually you will not need to create a GearmanJob object. The GearmanJob instance will be passed to a registered function with the job server when GearmanWorker::addFunction is used: <?php // create the worker $worker= new GearmanWorker(); // add the default job server (localhost) $worker->addServer('127.0.0.1', 4730); // define a variable to hold application data $count = 0; // add the reverse function $worker->addFunction('reverse', 'my_reverse_function', $count); // start the worker listening for job submissions while ($worker->work()); function my_reverse_function(GearmanJob $job, &$count) { $count++; return $count . ': ' . strrev($job->workload()) . "\n"; } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 46.102.29.170 ---- Manual Page -- http://php.net/manual/en/gearmanjob.construct.php Edit -- https://master.php.net/note/edit/117673 Del: integrated -- https://master.php.net/note/delete/117673/integrated Del: useless -- https://master.php.net/note/delete/117673/useless Del: bad code -- https://master.php.net/note/delete/117673/bad+code Del: spam -- https://master.php.net/note/delete/117673/spam Del: non-english -- https://master.php.net/note/delete/117673/non-english Del: in docs -- https://master.php.net/note/delete/117673/in+docs Del: other reasons-- https://master.php.net/note/delete/117673 Reject -- https://master.php.net/note/reject/117673 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203139) next »