admiralarjun Yes it can't be done without any interaction as If i will execute it every second then it will add heavy load on your server and I made it to also run on low end servers and also pusher does the same it also requires interaction and You can also scroll up and down if you don't want to like or you can simply open composer and close that!!
Note : Pusher also requires interaction !!
1Dot Note : Pusher also requires interaction !!
Oh that's new..
Here's some information I drafted about websockets and polling a while ago;
luceos I tested it myself it really requires interaction and also this Discuss also requires it and I tested it 1000 times!!!!
I always open 2 windows whenever I post in my empty title name test discussion! https://discuss.flarum.org/d/27942/28
luceos Note : Pusher also requires interaction !!
If it's set correctly, it does NOT require interaction. I used Pusher for over a year on my first forum, and never had to reload or anything. It works as a websocket should do.
1Dot I tested it myself it really requires interaction
This does not always happen, but I confirm that the problem does occur in Pusher
Maybe because there is no m.redraw() here?
rafaucau Yes and its same in this Jugaad Posts Realtime Polling extension that this problem does not occurs always!
rafaucau Can you tell me what m.redraw() does?
But don't use it in the view method because your code will fall into an infinite loop.
1Dot Yes and its same in this Jugaad Posts Realtime Polling extension
I have checked your extension code and I know why the problem occurs for you. Because you have written the extension in such a way that when the redraw happens, it only fetches the posts
composer update ramesh-dada/realtime
php flarum cache:clear
Thanks to @rafaucau
Add discussion list support auto update discussion list!!
I updated in my production forum as per @rafaucau suggested with m.redraw and the server load gone to 97% Cpu usage every second Is it expected behaviour???
1Dot I said if you use it wrong it will fall into an infinite loop 😃
rafaucau Can you tell me how to use it in a better way please!! 🤣
1Dot You should use debounce function
Wait, I'll do a PR because I'm curious about this feature
Ramesh Dada OP 🔥
alphadot Thanks a Lot, I will add a update in a second then use it don't install it now! 😅
rafaucau Wait, I'll do a PR because I'm curious about this feature
Super Ultra Pro THANKS I am waiting for you my friend 😄
rafaucau Any Progress on this?
@1Dot How about making it refresh the posts every second, for example (without interaction).
Does it have to be when the user does something on the page (with interaction)?
Because I'm not sure if the interaction thing was intentional.
rafaucau Because I'm not sure if the interaction thing was intentional.
Yes it requires interaction
rafaucau How about making it refresh the posts every second, for example (without interaction).
Yes with set interval i tried but it adds 100% load again!!
@rafaucau So any other way in order to load every second!
1Dot Yes with set interval i tried but it adds 100% load again!!
And if it would work well wouldn't interaction be required in this extension? You probably had a problem with an infinite loop here too, but that's easily fixed
Because you can make it refresh every second, but only if the user has the window focused.
rafaucau For this I will need someone's help as I am beginner I mean I literally don't know PHP properly..
rafaucau I can do a refresh every second so often
Yes it will be great if it will be without interaction and works like a pro without adding 100% load on server !
rafaucau but that's easily fixed
I am unable to see any PR
1Dot No no no. I'm doing this feature now and wondering how to approach it. I can do a refresh every so often, which will be easier, or with interaction which will be more difficult