A set of synchronous / asynchronous clients to use to query a Gloubster Server.
Use composer to add it in your project :
{
"require": {
"gloubster/client": "0.1.*"
}
}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 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');// todo
Gloubster PHP Client is released under the MIT license.
