sidrit
Listening for broadcast events
It’s a good point. The WS integration on my end is still on the exploratory phase. There will be some things that need an open WS channel no matter what, some that are fine with -some level- of polling and some other ones with a hybrid approach : subscription on a page level and rehydrate only when needed
40 replies
Listening for broadcast events
So what i'm trying to do now, before i take the custom TextColumn route is figure out a way to access the $livewire instance for a TextColum while in the table() method. Livewire has a setListeners() method that can be called, well, to register listeners.
40 replies
Listening for broadcast events
Here's the idea. Let's imagine an uptime checker or something. You have a list of sites. Either in a table or Infolist. For each one of thse let's stay you have a
status
item. There is a schedule in the system that periodically fires checks for uptime. When you're looking at the sites list, after the check is done, we update the status
with some information. The idea is to get each one of these sites to subscribe to their own channel and listen to their own events.40 replies
Listening for broadcast events
Not sure i understand the question. This broadcast message i was using (and likely the one i will be setting up) will carry over a DTO or just a POPO. It will be on a
private
channel non the less and likely will need to go through policies
40 replies
Listening for broadcast events
Tomorrow i'm going to figure out how to actually get the listening done on a TextEntry or TextColumn level. This listener here was just to check the piping. But it guess since those are Livewire components as well i'm either going to have to somehow set the listener (i think here is a setListeners() method) when i set up the TextEntry/TextColumn on the injected $livewire or go ahead and define a custom TextEntry/TextColumn and add listening capabilities to those
40 replies
Listening for broadcast events
The syntax is a bit different. For private channels it's
"echo-private:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted'
instead of "echo:App.Models.User." . auth()->id() . ",GlobalCheckCompletedEvent" => 'handleGlobalCheckCompleted'
40 replies
Listening for broadcast events
I think more than laravel it might be livewire. https://livewire.laravel.com/docs/events#real-time-events-using-laravel-echo. I've used echo and Livewire a number of times before and this has been the m.o. since it appeared as a feature in 2.x
40 replies
Listening for broadcast events
The getListeners() method of the component is getting called. But the handler for the given event is not. So i know that GlobalCheckCompletedEvent is getting fired in the system but although the listener is registered, the handler
handleGlobalCheckCompleted
is never getting called. So either my syntax is wrong, i'm missing something, or GlobalCheckCompletedEvent is not making it in this component.40 replies
Listening for broadcast events
The event is fired. I can see it in the queue. I can see it in the reverb debug window and i can even listen for it (outsite of filament in a plain blade file) by subscribing via javascript. The Livewire listener is set up (via getListeners) but the handler (method called handleGlobalCheckCompleted is not invoked).
40 replies