You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Mulkave no I mean from another php script. Like, minion is running as a Websocket Server, and somewhere else on your application an http request gets made that triggers an action (like creating a news item), is it possible to push a message to the Websocket Server from that script?
User A is online, connected to WS server
User B posts a news item
PHP notifies WS server news item was created (push)
WS server notifies user A a new news item is available.
definitely. It has to do with the channel that you're connecting to. Basically when user A is online, they should register to the messages that are expected to be published by the provider as in this example https://github.com/Vinelab/minion#provider-classes.
I think you did, yes. In this case, User B is not connected to the Websocket Server. So from my backend PHP code, after creating the News item, can I then send a message to the running Minion instance from my PHP code?
Basically I'm trying to do something like this example.
Pretty late to the party...sorry. There is no simple answer to this question unfortunately. There are a ton of methods that you could use to do this. Here are a few:
Your PHP script can create a Thruway client, or a minion client to connect to the same realm, and publish to a topic that the minion has subscribed to.
Configure your WAMP Router (like Crossbar) to publish to a topic using HTTP requests and use an HTTP request to publish to a topic your minion is subscribed to.
You can use a message or task queue like RabbitMQ or Beanstalkd which your minion will pull from.
Your minion can open a file, or unix socket to read from which your PHP script will write to.
The script can insert a row of data to a database which is queried by the minions.
Activity
Mulkave commentedon Nov 11, 2016
@CupOfTea696 What do you mean by another script? Something from Javascript for example?
CupOfTea696 commentedon Nov 11, 2016
@Mulkave no I mean from another php script. Like, minion is running as a Websocket Server, and somewhere else on your application an http request gets made that triggers an action (like creating a news item), is it possible to push a message to the Websocket Server from that script?
Mulkave commentedon Dec 21, 2016
definitely. It has to do with the channel that you're connecting to. Basically when user A is online, they should register to the messages that are expected to be published by the provider as in this example https://github.com/Vinelab/minion#provider-classes.
Or did I misunderstood your example?
CupOfTea696 commentedon Dec 22, 2016
I think you did, yes. In this case, User B is not connected to the Websocket Server. So from my backend PHP code, after creating the News item, can I then send a message to the running Minion instance from my PHP code?
Basically I'm trying to do something like this example.
NeoVance commentedon Mar 30, 2018
Pretty late to the party...sorry. There is no simple answer to this question unfortunately. There are a ton of methods that you could use to do this. Here are a few: