All Projects → moolex → nsqclient-php

moolex / nsqclient-php

Licence: MIT license
Yet another PHP client for NSQ

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to nsqclient-php

nsqworker
A skeletal guide of one way to implement a nsq consumer
Stars: ✭ 43 (+126.32%)
Mutual labels:  nsq
funboost
pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和全球一切知名消息队列中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数。旧名字是function_scheduling_distributed_framework
Stars: ✭ 351 (+1747.37%)
Mutual labels:  nsq
gobroker
golang wrapper for all (to-be) kinds of message brokers
Stars: ✭ 15 (-21.05%)
Mutual labels:  nsq
go-starter
Go 服务框架脚手架. 整合 echo、swag、viper、nsq、logrus、fx、xorm、cobra 等第三方库
Stars: ✭ 145 (+663.16%)
Mutual labels:  nsq
go-graphql-subscription-example
☝️ go-graphql subscription over Kafka/Redis/NSQ example
Stars: ✭ 34 (+78.95%)
Mutual labels:  nsq
Go Nsq
The official Go package for NSQ
Stars: ✭ 2,045 (+10663.16%)
Mutual labels:  nsq
Nsq
A realtime distributed messaging platform
Stars: ✭ 20,663 (+108652.63%)
Mutual labels:  nsq
lua-resty-nsq
lua-resty-nsq - Lua nsq client driver for the ngx_lua based on the cosocket API
Stars: ✭ 18 (-5.26%)
Mutual labels:  nsq
triton
Triton is a high-performance mq consumer, support kafka,rabbit-mq,rocketmq,nsq and other mq
Stars: ✭ 19 (+0%)
Mutual labels:  nsq
go-nsq
No description or website provided.
Stars: ✭ 57 (+200%)
Mutual labels:  nsq
public
util toolkit for go.golang 通用函数包
Stars: ✭ 135 (+610.53%)
Mutual labels:  nsq
verticegateway
REST API server with built in auth, interface to ScyllaDB/Cassandra
Stars: ✭ 25 (+31.58%)
Mutual labels:  nsq
nsqproxy
NSQProxy是NSQ和Worker之间的中间件,根据配置负责消息转发。然后通过HTTP/FastCGI/CBNSQ等协议转发给Worker机执行。
Stars: ✭ 79 (+315.79%)
Mutual labels:  nsq
nsq-0.3.7
nsq注释版基于0.3.7版本
Stars: ✭ 45 (+136.84%)
Mutual labels:  nsq
pan
Pan is a high performance mq proxy,support kafka,rabbit-mq,rocketmq,nsq and other mq
Stars: ✭ 27 (+42.11%)
Mutual labels:  nsq

NSQClient

Yet another PHP client for NSQ

Installation (via composer)

composer require moolex/nsqclient dev-master

Usage

Publish

$topic = 'my_topic';
$endpoint = new \NSQClient\Access\Endpoint('http://127.0.0.1:4161');
$message = new \NSQClient\Message\Message('hello world');
$result = \NSQClient\Queue::publish($endpoint, $topic, $message);

Publish (deferred)

$topic = 'my_topic';
$endpoint = new \NSQClient\Access\Endpoint('http://127.0.0.1:4161');
$message = (new \NSQClient\Message\Message('hello world'))->deferred(5);
$result = \NSQClient\Queue::publish($endpoint, $topic, $message);

Publish (batch)

$topic = 'my_topic';
$endpoint = new \NSQClient\Access\Endpoint('http://127.0.0.1:4161');
$message = \NSQClient\Message\Bag::generate(['msg data 1', 'msg data 2']);
$result = \NSQClient\Queue::publish($endpoint, $topic, $message);

Subscribe

$topic = 'my_topic';
$channel = 'my_channel';
$endpoint = new \NSQClient\Access\Endpoint('http://127.0.0.1:4161');
\NSQClient\Queue::subscribe($endpoint, $topic, $channel, function (\NSQClient\Contract\Message $message) {
    echo 'GOT ', $message->id(), "\n";
    // make done
    $message->done();
    // make retry immediately
    // $message->retry();
    // make retry delayed in 10 seconds
    // $message->delay(10);
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].