-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding a websocket session and send message #26
Comments
Hi @lucaskuan , Thank you for opening this issue. I understand your need to send a message to a specific connection and I recommend that you switch to the pub/sub API for this need (the API was updated in iodine 0.6.0, but Plezi still uses iodine 0.4.19 until I release the update I'm working on). The issue is simple (and the confusion is one of the reasons that When you use However, pub/sub is cluster wide and can be easily extended using Redis to support multi-machine horizontal scaling (which allows your messages to cross machine boundaries). If you give each user a private channel (i.e., I hope tis helps. Good Luck! |
Thanks for your instant reply! 🥇 |
It was mostly luck... but you're welcome :-)
Yes, this is a good option if you are running multiple instances of your application (i.e., running the application on multiple machines or, on Heroku, using multiple dynos). With Plezi, this can be automated by setting the Also, please note: if you are running a single process cluster (one call to In fact, if your running only a single application instance (i.e., one iodine cluster), Redis will only slow the application down. |
I'm playing around with the publish and found out the publish won't work without |
It should work out of the box. Please update to iodine 0.4.19 and try again. |
Please let me know if you still have an issue after upgrading to iodine 0.4.19 (also, please consider upgrading to Plezi 0.5.1). Thank you for opening this issue. B. |
Since I'm not ready to do upgrade and testing. Close this issue first and try later |
Okay, thank you :-) P.S. Please note that iodine 0.4.19 should be 100% compatible with iodine 0.4.15, the patch version updates only include bug fixes. It should be easy to upgrade to iodine 0.4.19 and Plezi 0.15.1 (no code changes). Plezi 0.16.0 and Iodine 0.6.2 are the latest versions and have some significant changes to the API (mostly due to collaborations in an attempt to create a Rack standard API for WebSocket connections and pub/sub). |
Hi, I was able to find a specific websocket session and send message to the client with following code
But now something not working as expected. The client keep sending message to server in every 15 seconds but I was not able to find it from the code above. The only change I made to the server related to plezi is changing iodine config from
-w 1
to-w 3
.Please help out if there any workaround or better way to find and send message to a specific websocket.
The text was updated successfully, but these errors were encountered: