nesquick / trafficcophp
PHP Client for Traffic Cop messsage queue.
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/nesquick/trafficcophp
Requires
- trafficcophp/bytebuffer: dev-master
This package is not auto-updated.
Last update: 2025-10-03 19:15:55 UTC
README
This is the official PHP client for TrafficCop. It provides a very simple client for basic usage but offers also very OO-Style usage. Just see examples for that.
Install
Installation should be done via composer.
{
"require": {
"nesQuick/TrafficCophp": "dev-master"
}
}
Example
You should have a look into the examples folder. A simple usage example could look like this
<?php require __DIR__ . '/../vendor/.composer/autoload.php'; use TrafficCophp\Client; $client = new Client('127.0.0.1', 3542); $client->publish('channel_two', 'A little test message from php client example'); $client->subscribe('channel_one', 'channel_two', 'channel_three'); while (true) { $client->receive(function($channel, $message) { printf('Got message "%s" on %s', $message, $channel); }); }
ToDo's
- write php doc
- cleanup use statements
- refactor channel collection
License
Licensed under the MIT license.