-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC][LiveComponent] Add options on polling feature (max/multiplier) #2448
Comments
Seems interesting Could you explain a bit more the feature, like how the max value would work, what "thing" the "retry" would handle / catch, etc etc ? |
for the retry its not like the case of messenger for failure, but more the same config idea but here for an element each new polling will increment the max value until it reaches and no more add the poll the state of such config could be saved into the payload and handled back and fort between server and client I suppose |
I'm wondering if this should be a generic attribute, or if we should add a "ComponentWithTimerTrait" or something like this. That sort of time manipulation is what i've been doing for the LiveMemory Timer component ux/ux.symfony.com/templates/demos/live_memory/components/LiveMemory/Timer.html.twig Lines 1 to 9 in dec3eb3
And i had in mind (before i forgot) to write about it and see if this could be improved / integrated in LiveComponent codebase |
nice one, did know about such demo |
Right now, i'm thinking delay/multiplier/etc seems very "retry" related for now. But the overall "time / activity" management seem something we could/should be able to improve and offer (someone on slack recently wanted it's component to refresh when user reoopen tab, i remember an issue about page with live component needed to render at specific time, etc etc) So maybe a way could be (thinking outloud here)
On the JS part we would need to handle some activity / page event we do not listen for now (device lock, freezes, background, user away, backward forward cache, etc etc) On the PHP side we probably specific event listeners for time... but nothing much here except some required time functions i suppose. In your case described in this issue: you would probably just need to add a trait and implement a method to compute the "next" polling time ... or something in that spirit. What do you think ? |
I think the helper on php side would be wise and relevant (aka a trait) |
Hi, I would like to know if a feature like that can be implemented (with ux live internal state/code)
If so, I would like to contribute if its accepted, any hint appreciated
https://symfony.com/bundles/ux-live-component/current/index.html#polling
as well, as this may open the way, perhaps a feature similar to messenger retry can be implemented ? (delay/max/multiplier)
Thanks,
The text was updated successfully, but these errors were encountered: