Closed jakubforman closed 1 month ago
Thank you for the pull request and the detailed explanation of why it is needed for your use case.
We're not adding new events to the project right now as they expose the possibility of blocking the event loop. For example, if the listener in your example is not queued, the event loop will be blocked since the message you are attempting to broadcast cannot be accepted until the listener execution completes and the listener execution cannot complete until the message has been broadcast. You end up in a deadlock.
Thank you for the pull request and the detailed explanation of why it is needed for your use case.
We're not adding new events to the project right now as they expose the possibility of blocking the event loop. For example, if the listener in your example is not queued, the event loop will be blocked since the message you are attempting to broadcast cannot be accepted until the listener execution completes and the listener execution cannot complete until the message has been broadcast. You end up in a deadlock.
I understand the deadlock, it has happened to me when I use Queues in sync mode, that's why you need to have it as a Queue through an external service (SQS, DB...) - it hasn't happened there yet. Would there be any chance to get those events in there in the future? Alternatively, what would I have to do to make it possible to catch these events there.
Hello, I also need such events. As far as I understand, does it mean that if the events are not queued, they will have problems? Well, put a variable in the config file to turn on and off the events so that anyone who needs it can use it. @joedixon
Adds sending events that can be handled to within
Event::listen()
.Why I created this PR:
I am responding to #185 in which the need to track these events arose and
PresenceChannel
is insufficient for this.Newly added events:
ClientConnected
ClientDisconnected
PusherSubscribe
PusherUnsubscribe
Each event is called similarly to the built-in original
MessageReceived
andMessageSent
events.The functionality can be extended using this PR as follows:
PusherUnsubscribe
event is also sentReal Example
Showing one admin panel with many of devices (players) and their status.
Code sample and usage
Inside
EventServiceProvider
Event Listener - Chnage in DB + Reverb Event Notification
Custom Event
DeviceDisconnected
- called vDeviceDisconnectNotificationWS
channels.php