Polling isn't real time though. You do need websockets in order to make something real time. The question that needs to be asked is if the thing you are making needs to be real time or not. Polling kind of does an automatic partial page reload at a set interval. The problem that I see with the implementation in this video is that polling will hit the database each time and it will effectively reload all data (even data that hasn't actually changed). I might be completely wrong though since I have never used livewire. On the other hand if you use the pubsub architecture then only when data has actually changed will data be sent over the wire, and only the data that has changed will be sent. All other data is still the same so it does not need to be reloaded.
You're correct Voidstroyer. This probably isn't the most efficient, but CAN be made efficient with Livewire. Essentially with Livewire polling you can tell the Poll to run a method on your server to get updated information. You could then have a query that only grabs the updated information and refreshes the component in that sense. But, for simple text base information and with a database like SQLite, the stress isn't that significant even if updating the entire page/component.
@@joshcirre I understand that. I come from the Phoenix Liveview world so this isn't an issue for me. Optomization is always tricky. I like it when the framework minimizes the stuff I need to optomize for manually.
Very cool video and great refresher. I'm going to switch most the polling in my apps to websockets, but I did a lot of conditional polling. Let's say a user interacts with a button, which triggers background jobs, the method turns on polling for the given visible page and with the result coming in after a while, turns the polling off again.
Josh you are being a nice help with those tips on laravel 🙏 Can you give me advice on How can i make something like zoom video conference with laravel. Is there a way without pusher ?
This would just be talking and pinging the server every few seconds to get a response. Reverb is a long running websocket connection. Rather Reverb is the server dispatching and listening to those events.
@@joshcirre yeah, it most likely will load the data as soon as you activate the tab this way but also makes it redundant to have that throttle built in into livewire
I love all your content, Josh. As a PHP and Laravel developer, I really enjoy every one of your videos.
Thank you so much for the encouragement. I appreciate it. ☺️
Thank you for the shoutout Josh 🙏
wire:poll is a great tool in our belt and could be really beneficial in some use cases 😊
Really useful, sometimes people think they need websockets to make something “real time” but many use cases can be satisfied by polling
Polling isn't real time though. You do need websockets in order to make something real time. The question that needs to be asked is if the thing you are making needs to be real time or not. Polling kind of does an automatic partial page reload at a set interval.
The problem that I see with the implementation in this video is that polling will hit the database each time and it will effectively reload all data (even data that hasn't actually changed). I might be completely wrong though since I have never used livewire. On the other hand if you use the pubsub architecture then only when data has actually changed will data be sent over the wire, and only the data that has changed will be sent. All other data is still the same so it does not need to be reloaded.
You're correct Voidstroyer. This probably isn't the most efficient, but CAN be made efficient with Livewire.
Essentially with Livewire polling you can tell the Poll to run a method on your server to get updated information.
You could then have a query that only grabs the updated information and refreshes the component in that sense.
But, for simple text base information and with a database like SQLite, the stress isn't that significant even if updating the entire page/component.
@@joshcirre I understand that. I come from the Phoenix Liveview world so this isn't an issue for me. Optomization is always tricky. I like it when the framework minimizes the stuff I need to optomize for manually.
Very cool video and great refresher. I'm going to switch most the polling in my apps to websockets, but I did a lot of conditional polling. Let's say a user interacts with a button, which triggers background jobs, the method turns on polling for the given visible page and with the result coming in after a while, turns the polling off again.
Ooo. That’s a great video idea. Conditional polling. I’d love to hear how you did that.
That might be a fantastic Livewire PR too. 👀
@@joshcirre hmm not sure it’s PR-worthy, but will look up the code I used and get back to you.
Josh you are being a nice help with those tips on laravel 🙏
Can you give me advice on
How can i make something like zoom video conference with laravel. Is there a way without pusher ?
Unfortunately, that's best with real time updates like Pusher or Laravel Reverb.
You could also use a specific service for that though too. :)
I was building on the concept of setting livewire update through Laravel Reverb / websockets, this would make apps more reactive than ever.
I did a video using Livewire with Reverb on the official Laravel channel. Check it out when you get the chance!
Hey Josh, I love your videos. Thank you so much. Can you please explain what is the difference between this and laravel reverb?
This would just be talking and pinging the server every few seconds to get a response. Reverb is a long running websocket connection. Rather Reverb is the server dispatching and listening to those events.
@@joshcirre If im using sushi to call an external api for dashboard data, would you recommend reverb or using this method with livewire?
Thanks josh..Please share about livewire always ✨️
Will do! 🫡
Can you build video calling screen sharing with Livewire
Hey, amazing video! i wonder how do you add those glossy border around your windows do you use screen studio?
This is all done in OBS actually before recording. I’ll have to make a video about it all. ☺️
Hey Josh! I was wondering what your keyboard is called and de switches? 😆
This is actually a keyboard switch “sound” on the Mac. It’s called Klack app. ☺️
Ahh amazing!
but the browser throttles timers on background tabs so that's not gonna work that smoothly anyway
Good point. But nice to have just in case you do need it not throttled by the standard 95% that Livewire does too. ☺️
@@joshcirre yeah, it most likely will load the data as soon as you activate the tab this way
but also makes it redundant to have that throttle built in into livewire
Just noticed you moved to functional API
I’ve been trying it out more!
@@joshcirre Awesome!
Wait till he finds out how easy websockets are in laravel and livewire 😂😂
Check the Laravel channel! I have a video on using Reverb with Livewire. 😁😏
@joshcirre oh I know you definitely know about websockwts
I'm just teasing