data-dog / php-nsq
NSQ publisher for PHP
Installs: 7 062
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 5
Forks: 5
Open Issues: 0
Requires
- php: >=5.3.0
- ext-sockets: *
Requires (Dev)
- phpspec/phpspec: ~2.0
This package is not auto-updated.
Last update: 2024-11-19 04:13:30 UTC
README
This library ONLY publishes messages to NSQ nodes. Requires standard php socket extension.
Install
Add to composer.json:
{ "require": { "data-dog/php-nsq": "~0.2.0" } }
Usage example
<?php include __DIR__ . '/vendor/autoload.php'; use Nsq\NsqPool; use Nsq\Socket\PhpSocket; use Nsq\Message\JsonMessage; $nsq = new NsqPool( new PhpSocket('127.0.0.1', 4150), new PhpSocket('127.0.0.1', 4170) ); $nsq->publish('my_topic', new JsonMessage(['message' => 'data']));
Run tests
composer install
./bin/phpspec run