Git Product home page Git Product logo

li3_queue's People

Contributors

agborkowski avatar cgarvis avatar jasonroyle avatar markwilde avatar mgcrea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

li3_queue's Issues

AMQPS (SSL) Support

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.

README

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...

implement pub/sub with ampq

@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();
        });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.