note 105391 added to gearmanclient.do

From: Date: Sun, 14 Aug 2011 09:38:01 +0000
Subject: note 105391 added to gearmanclient.do
Groups: php.notes 
Request: Send a blank email to php-notes+get-182475@lists.php.net to get a copy of this message
@shane: It turns out that do() is in-fact blocking. Specifically, it will not return until either the results of the job are returned from the server, or a timeout occurs. The notable exception to this, is if a job returns status information of some sort. <?php self::$gmclient= new GearmanClient(); self::$gmclient->setTimeout(15000); self::$gmclient->addServer(self::$server); printf("%s: calling do()\n", date("H:i:s")); $value = self::$gmclient->do($function, $args); printf("%s: do() returned %d\n", date("H:i:s"), $value); /* Output: 19:28:06: calling do() Warning: GearmanClient::do(): gearman_wait:timeout reached in trunk/MyGearmanClient.php 19:28:17: do() returned 0 */ ?> Note the ~ 15 seconds between invocation and return, as specified in setTimeout ---- Server IP: 69.147.83.197 Probable Submitter: 111.223.237.154 ---- Manual Page -- http://www.php.net/manual/en/gearmanclient.do.php Edit -- https://master.php.net/note/edit/105391 Del: integrated -- https://master.php.net/note/delete/105391/integrated Del: useless -- https://master.php.net/note/delete/105391/useless Del: bad code -- https://master.php.net/note/delete/105391/bad+code Del: spam -- https://master.php.net/note/delete/105391/spam Del: non-english -- https://master.php.net/note/delete/105391/non-english Del: in docs -- https://master.php.net/note/delete/105391/in+docs Del: other reasons-- https://master.php.net/note/delete/105391 Reject -- https://master.php.net/note/reject/105391 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#182475) next »