d10sfan
d10sfan7mo ago

How do I poll every x seconds on an app?

I have an app that I want to run a script every x seconds on, and have the ability to run a frontend script when it's successful each time, to add the data to the state. I see that there's a while loop in the flow, but it does not look like that would allow me to get the results on each success, just at the end.
3 Replies
wayne
wayne7mo ago
@d10sfan but why not just put the while loop in the frontend? you want that: frontend call -> windmill flow running and sending things back to the frontend every x seconds ? Because I think it's easier to do: while loop in frontend calling windmill ---> flow doing stuff and responding back
d10sfan
d10sfan7mo ago
yeah i did something similar thanks! i did a fetch flow, then that caused a frontend script to run that had a promise that resolved after x seconds, and then on the finish of that script, it calls the flow
wayne
wayne7mo ago
yeah that sounds like the right way to do it