1Dot luceos This is incorrect. Polling causes far more load on the server than websockets. Depending on the interval you can compare it with refreshing the page every single time, except that it doesn't load html, css and JavaScript. All data still is being gathered from the API when polling. OK I am sorry, I messed up! 😅 I edited it to without any heavy load!
1Dot User24 This simply execute a function when user do some activity like scrolling hovering mouse here and there and if you like someone's post then it execute the same function as pusher does!! and show you the new posts!!
User24 1Dot if you like someone's post then it execute the same function as pusher does!! and show you the new posts!! So for this to work, they should like any post within the thread? Can't it be done without any interaction?
1Dot User24 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 !!
luceos 1Dot Note : Pusher also requires interaction !! Oh that's new.. Here's some information I drafted about websockets and polling a while ago; https://discuss.flarum.org/d/1727-what-does-pusher-do-exactly/13
1Dot 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
[deleted] 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.
rafaucau 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? https://github.com/flarum/pusher/blob/master/js/src/forum/index.js#L114
1Dot rafaucau Yes and its same in this Jugaad Posts Realtime Polling extension that this problem does not occurs always!
rafaucau 1Dot https://mithril.js.org/autoredraw.html It re-renders. 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
1Dot Update v99.4 Fixed Minor Issues. Now It doesn't even requires interaction works like a pro, I mean ultra pro. Update composer update ramesh-dada/realtime php flarum cache:clear Thanks to @rafaucau To Do Add discussion list support auto update discussion list!!
1Dot 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???
rafaucau 1Dot You should use debounce function Wait, I'll do a PR because I'm curious about this feature
1Dot 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 😄 Edit rafaucau Any Progress on this?
rafaucau 1Dot Yes. @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.