ClankBundle icon indicating copy to clipboard operation
ClankBundle copied to clipboard

How to implement "Push to an Existing Site" using ZeroMQ?

Open ghost opened this issue 12 years ago • 4 comments

I need to implement the Push to an Existing Site feature mentioned in the Ratchet documentation.

However, I found no clues on how to accomplish this functionality using Clankbundle! Could you please demonstrate (preferably with code) how would one use ZeroMQ with Clankbundle?

Other than that keep up the terrific work :+1:

ghost avatar Nov 25 '13 18:11 ghost

actually, you don't really need ZeroMQ. you can connect and publish directly to the Ratchet ws server from your pushing script, you only need a php ws client like this one https://github.com/gabrielbull/php-websocket-client

kor3k avatar Feb 19 '14 19:02 kor3k

@kor3k Sorry, but I don't see how this could be used instead of ZeroMQ. This code looks like it's running it's own server. How is that related to sending messages between Ratchet and my scripts?

ghost avatar Feb 19 '14 20:02 ghost

@sherifsabry20000 not a server, a client. you can connect/publish to your ws server with it instead of zmq in your php scripts.

you only need to stop the client's loop at some point.

https://github.com/kor3k/ratchet/blob/master/src/Test/Pusher.php https://github.com/kor3k/ratchet/blob/master/web/pusher.php

kor3k avatar Mar 06 '14 17:03 kor3k

@sherifsabry20000 I looked for the same feature. I wanted to send a private message to the websocket server from a normal Symfony2 controller, hence e.g. if I update or add some record to the database I want to send a notification to the user via websockets. I have implemented Push system using ZeroMQ in my fork, I guess that is what you are looking for ? https://github.com/peec/ClankBundle/blob/master/Resources/docs/ZMQIntegration.md

peec avatar Sep 18 '14 19:09 peec