Vinelab / minion

A Simplified Client for WAMP v2 (Web Application Messaging Protocol) with command line support - PHP WebSocket Made Easy
MIT License
126 stars 16 forks source link

How to publish from a controller #9

Closed patricknazar closed 6 years ago

patricknazar commented 8 years ago

I know this isn't a bug, but I've worked it all out except how to publish from a controller, not the Service Provider. There may be a gap in my understanding but how do I do it? For example when a user's details are updated, I'd like to send a broadcast to anyone watching that.

Thanks

Mulkave commented 8 years ago

Unfortunately at the moment the functionality is not exposed to controllers. A workaround for that would be to instantiate a provider inside the controller (better inject it as a dependency), then call the boot method on it, and call sendMessage($args, $data).

PS: Not sure if this will surely work, just suggesting 😄 . If you figure out a better way please share, or even better a PR is much appreciated.

teamworktf commented 7 years ago

So from my understanding there is physicial seperation between your PHP web-app and the Minion deamon running for the websocket.

Would something like ZeroMQ suffice as an interaction layer between those two?

Mulkave commented 6 years ago

@teamworktf Can you please clarify what you mean by "physicial seperation between your PHP web-app and the Minion deamon"?