Git Product home page Git Product logo

Comments (10)

jjsaunier avatar jjsaunier commented on June 14, 2024

Currently this feature is missing, i will look to implement this ! :)

from websocketbundle.

parhamdoustdar avatar parhamdoustdar commented on June 14, 2024

I can try and implement it and send you a pull request if you'd like. I would need more details on how it's going to work, though.

Possibilities could be a configuration value called zmq_host and zmq_port, and when these are required, the command creates a React\ZMQ instance and passes that to the server. On the other end, you'd need to have TopicWithMessageInterface that also has an onMessage() function added to those defined by TopicInterface.

There could then be a zmq_client service defined in the dependency injection container that is the result of calling getSocket() with ZMQ::SOCKET_PUSH which users can then use to push messages onto the queue.

All of this will make your library dependent on ext_zmq, though.

from websocketbundle.

jjsaunier avatar jjsaunier commented on June 14, 2024

I appreciate thank you ;)

Keep in your head that feature must be togglable in order to run this bundle when ZMQ is not installed and not needed. Like ratchet approach no composer require just a good docs about to explain how implements push integration

from websocketbundle.

parhamdoustdar avatar parhamdoustdar commented on June 14, 2024

Hi,

Here is what I and my colleague have come up with. I'm double-checking with you to make sure it's what you want:

  1. We will add a zmq_server key to the configuration. It will have host and port options only, and the values can also be overridden through parameters, just like host and port for the server key.
  2. We will add a second server called ZMQServer which implements the Gos\Bundle\WebSocketBundle\Server\Type\ServerInterface. Since we are not going to have origin checking, this service would accept LoopInterface, EventDispatcherInterface, WampApplicationInterface, and LoggerInterface.
  3. In the launch function, we build the stack, adding the ZMQ server to it, without periodic and origin checking.
  4. We add a new command, gos:zmq:server, which gets this new server as its entryPoint and calls launch() on it.

Is this okay?

from websocketbundle.

jjsaunier avatar jjsaunier commented on June 14, 2024

Globally, yes.

Forget ZMQ when you code, use PUSH because ZMQ is only ONE technology to transport like AMQP/STOMP, websocket client, redis PUB/SUB for example.

  • zmq_server become push_server
  • ZMQServer become PushServer
  • gos:zmq:server become gos:push:server

1

We will add a zmq_server key to the configuration. It will have host and port options only, and the values can also be overridden through parameters, just like host and port for the server key.

Add also a type to have :

push_server:
    host: 12.0.0.1
    port: 3349
    type: zero_mq

2

Like I said before,

ZMQServer -> PushServer
ZMQ implementation -> ZmqTransport with common interface to have something like :

class PushServer
{
    public function __construct(TransportInterface $transport)
    {
          //transport (zmq, websocket client etc we dont care of what is behind, that transport
transport)
    }
}

4

We add a new command, gos:zmq:server, which gets this new server as its entryPoint and calls launch() on it.

Don't forget to allow to run command process with optional ip / port in order to load balance ;) (like websocket do today) and your static ip / port in config file point on load balancer.

What do you think about that ?

from websocketbundle.

parhamdoustdar avatar parhamdoustdar commented on June 14, 2024

I think I get most of what you mean. However, is there somewhere we can chat about this? I'd like to iron out some details?

from websocketbundle.

jjsaunier avatar jjsaunier commented on June 14, 2024

yes here : https://gitter.im/GeniusesOfSymfony/WebSocketBundle

from websocketbundle.

parhamdoustdar avatar parhamdoustdar commented on June 14, 2024

All right, I've joined.

from websocketbundle.

jjsaunier avatar jjsaunier commented on June 14, 2024

ref #39

from websocketbundle.

jjsaunier avatar jjsaunier commented on June 14, 2024

🎉

from websocketbundle.

Related Issues (20)

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.