Client.php
PHP version 5.1.0+ 7+
LICENSE: This source file is subject to the New BSD license that is available through the world-wide-web at the following URI: http://www.opensource.org/licenses/bsd-license.php. If you did not receive a copy of the New BSD License and are unable to obtain it through the web, please send a note to license@php.net so we can mail you a copy immediately.
- Author
- Joe Stump
- Category
- Net
- Copyright
- 2007-2008 Digg.com, Inc.
- License
- New BSD License
- Link
- http://pear.php.net/package/Net_Gearman
- Link
- http://www.danga.com/gearman/
- Package
- ShSo\Net\Gearman
- Version
- CVS: $Id$
\ShSo\Net\Gearman\Client
This class is used by code submitting jobs to the Gearman server. It handles taking tasks and sets of tasks and submitting them to the Gearman server.
- Author
- Joe Stump
- Category
- Net
- Copyright
- 2007-2008 Digg.com, Inc.
- License
- New BSD License
- Link
- http://www.danga.com/gearman/
- Version
- Release: @package_version@
Properties
Methods

__call(string $func, array $args = array()) : voidFire off a background task with the given arguments
| Name | Type | Description |
|---|---|---|
| $func | string | Name of job to run |
| $args | array | First key should be args to send |

getConnection() : resourceGet a connection to a Gearman server
| Type | Description |
|---|---|
| resource | A connection to a Gearman server |

handleResponse(array $resp, resource $s, object $tasks) : voidHandle the response read in
| Name | Type | Description |
|---|---|---|
| $resp | array | The raw array response |
| $s | resource | The socket |
| $tasks | object | The tasks being ran |
| Exception | Description |
|---|---|
| \ShSo\Net\Gearman\ShSo\Net\Gearman\Exception |

runSet(object $set, integer $timeout = null) : voidRun a set of tasks
| Name | Type | Description |
|---|---|---|
| $set | object | A set of tasks to run |
| $timeout | integer | Time in seconds for the socket timeout. Max is 10 seconds |