Why does front and back end connection gets suspended when time.sleep() is running?

Hi @sai_krishna1, thank you for the answer!

Iโ€™m creating a real-time monitoring system for a graph data acquisition module. For the most part, Iโ€™m using MUI. Every time Iโ€™m using the st.spinner, the entire MUI dashboard goes away, while the spinner is only visible. When the processes within st.spinner() finish, the dashboard is visible again. I would like to avoid that.

The reason Iโ€™m using time delay is to avoid reaching quotas when requesting data from the server. However, reaching the quotas is inevitable, so a status code 429 is returned or some other status code, letting me know that the request was unsuccessful. In these cases, the logic is to enter a while loop, make a request every t seconds, until the request is successful.

Iโ€™m looking for a way to implement this logic with MUI, without sacrificing the UI experience. The desired outcome would be to have a countdown, while the entire app is still responsive. However, Iโ€™m not sure itโ€™s possible with streamlit.

The best solution Iโ€™ve found is this implementation but Iโ€™m facing the same issue, as with st.spinner(); the entire dashboard goes away until the countdown is finished.