unionofrad / li3_queue Goto Github PK
View Code? Open in Web Editor NEWMessage and job queuing for li3.
Message and job queuing for li3.
I have used this library for some time now but have recently moved our RabbitMQ servers and now wish to communicate over AMQPS. After a quick search I have found nothing relating to AMQPS, SSL or certificates in this repository and after searching the Lithium repository I didn't find anything there that helps me either. Am I missing something or does Lithium not actually have SSL networking capability? In which case this should probably be a Lithium issue.
Are there plans for a readme explaining the usage of this library?
Seems potentially useful but I cant be sure unless I the time to investigate the code...
@markwilde any suggestion to implement pub/sub for ampq adapter, for each queue in ampq class should generate new uniq queue ;/ there is impossible i think with actual configuration
@link https://www.rabbitmq.com/tutorials/tutorial-three-php.html
i did workaround for pub/sub with config:
use li3_queue\storage\Queue;
Queue::config(array(
'li3.publisher' => array(
'adapter' => 'AMQP',
'host' => 'localhost',
'port' => 5672,
'user' => 'guest',
'pass' => 'guest',
'vhost' => '/',
'exchange' => 'amq.fanout',
'queue' => 'li3.events.1',
'routingKey' => 'li3.events',
'autoConfirm' => false,
'readTimeout' => 0,
'type' => AMQP_EX_TYPE_FANOUT,
'prefetchCount' => 1
),
'li3.subscriber.1' => array( #same like publisher jus for clarify
'adapter' => 'AMQP',
'host' => 'localhost',
'port' => 5672,
'user' => 'guest',
'pass' => 'guest',
'vhost' => '/',
'exchange' => 'amq.fanout',
'queue' => 'li3.events.1',
'routingKey' => 'li3.events',
'autoConfirm' => false,
'readTimeout' => 0,
'type' => AMQP_EX_TYPE_FANOUT,
'prefetchCount' => 1
),
'li3.subscriber.2' => array(
'adapter' => 'AMQP',
'host' => 'localhost',
'port' => 5672,
'user' => 'guest',
'pass' => 'guest',
'vhost' => '/',
'exchange' => 'amq.fanout',
'queue' => 'li3.events.2',
'routingKey' => 'li3.events',
'autoConfirm' => false,
'readTimeout' => 0,
'type' => AMQP_EX_TYPE_FANOUT,
'prefetchCount' => 1
)
));
publish evets
Queue::write('li3.publisher', json_encode(['model' => 'Users', 'method' => 'save', 'id' => $entity->user_id] + compact('options')));
two consumers # - 1,2 receive same event info eg
{"model":"Users","method":"save","id":"4023","options":{"validate":false,"whitelist":["profile_id"]}}
Queue::consume('li3.subscriber.#', function($message) {
sleep(2);
$this->out($message->data());
//$message->confirm();
//if (false) {
// Confirm message
$message->confirm();
//}
// Requeue message
//$message->requeue();
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.