Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
addition:another option could be in the workflow definition have cdf task as the last task of the workflow. After the function has completed its execution the cdf task triggers a new run/execution of the same workflow. it’s important to keep restrictions and limits around workflows in mind
Thanks for adding this example. Streamlit in the browser (running with pyodide) does not work the same as a local run of Streamlit. The GH issue below addresses your problem and also suggests a solution by using an async function (with asyncio library). I’ve tested this example in Streamlit within CDF and it works.Related GH issue: https://github.com/whitphx/stlite/issues/34#issuecomment-1475722165Let me know if this solves your case.
Hi Tibor,Streamlit's primary mode of operation is based on scripting, meaning it runs from top to bottom each time there's an interaction, updating all the components. In the examples you provided, Streamlit won't wait for things like `time.sleep()` or loop delays in the way that you're expecting.For your specific examples:1. The `st.spinner('Wait for it...')` with the `time.sleep(5)` will not display the spinner for 5 seconds before showing "Done!". Instead, Streamlit will finish the entire script execution (including the sleep time) and then update the app interface.2. In your second example, the loop keeps the script busy until `func_call.status` is no longer "Running". Only after the loop finishes does Streamlit get a chance to update the interface, causing the "Waiting for function..." to appear briefly or not at all, depending on how quickly the subsequent updates occur.To achieve the desired effect in Streamlit:1. For the spinner example: There's no direct way to make `st.spinne
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.