gloubster/client
There is no license information available for the latest version (dev-master) of this package.
Gloubster PHP client
dev-master
2013-01-11 12:58 UTC
Requires
- gloubster/communications: dev-master
Requires (Dev)
- guzzle/guzzle: 3.*
- silex/silex: 1.0.x-dev
- ext-zmq: *
Suggests
- ext-zmq: ZMQ PHP extension is required to use the ZMQ client
- guzzle/guzzle: Guzzle Client is required to use the Http Client
README
A set of synchronous / asynchronous clients to use to query a Gloubster Server.
Use in your project
Use composer to add it in your project :
{ "require": { "gloubster/client": "0.1.*" } }
Synchronous Clients
Synchronous clients are commonly used like in the following example, specific clients use are described below.
use Gloubster\Exception\ClientRequestException; use Gloubster\Exception\ClientNotAcknowledgedRequestException; try { $acknowledgement = $client->send($job); } catch (ClientRequestException $e) { echo "An error occured while querying Gloubster Server, the response was not understood\n"; echo sprintf("Server answered : %s\n", $e->getResponse()); } catch (ClientNotAcknowledgedRequestException $e) { echo sprintf("Gloubster Server did not acknowledge the query for " . "the following reason : %s \n", $e->getAcknowledgement()->getReason()); }
ZeroMQ Client
ZeroMQ client is very easy to use ; you just to have to provide $transport
,
$host
and $port
.
use Gloubster\Client\Sync\ZMQClient; // Will connect to ZMQ socket tcp://localhost:12300 $client = ZMQClient::create('tcp', 'localhost', '12300');
Asynchronous Clients
// todo
License
Gloubster PHP Client is released under the MIT license.