gonzalo123 / zmqlifo
LIFO Queue with ZeroMQ
dev-master
2013-06-24 12:47 UTC
Requires
- php: >=5.3.2
- ext-zmq: *
- symfony/process: ~2.2
This package is not auto-updated.
Last update: 2024-11-09 15:12:05 UTC
README
ZeroMQ LIFO Queue
usage examples:
Client:
<?php include __DIR__ . '/../vendor/autoload.php'; use Zmqlifo\Client; $queue = Client::factory('tcp://127.0.0.1:4444'); echo $queue->run("ls -latr")->getOutput(); echo $queue->run("pwd")->getOutput();
Server
<?php include __DIR__ . '/../vendor/autoload.php'; use Symfony\Component\Process\Process; use Zmqlifo\Server; $server = Server::factory('tcp://127.0.0.1:4444'); $server->registerOnMessageCallback(function ($msg) { $process = new Process($msg); $process->setTimeout(3600); $process->run(); return $process->getOutput(); }); $server->run();