Yue1Harriet1 / streamlitrq

3 stars 1 forks source link

Auto-refresh for task status #7

Closed sfc-gh-jcarroll closed 2 weeks ago

sfc-gh-jcarroll commented 2 weeks ago

Hi Harriet Yue,

I came across this repo from the talk at PyData London. I'm on the Streamlit team. This is awesome!!

I saw you are doing refresh() today with a sleep and then rerun exception. I wondered if you considered using st.experimental_fragment(run_every=) kwarg for those updates. Something like this.

Also, is this in a state where you'd be happy for it to be amplified? Someone else on the Streamlit team might be interested to chat :)

Cheers! Thank you for this awesome project!! Joshua

Yue1Harriet1 commented 2 weeks ago

Thanks for your feedback Josh! Let me play some experiments and improve something!!! Cheers

sfc-gh-jcarroll commented 2 weeks ago

Oh one more since you mentioned in your talk - might be interested to talk with @Asaurus1 about https://github.com/Asaurus1/streamlit-process-manager

Yue1Harriet1 commented 2 weeks ago

nice thanks for the introduction!

Asaurus1 commented 2 weeks ago

Thanks Joshua,

This project looks to be in a very similar vein to SPM but using an external task runner and message broker to handle transactions -- which is honestly probably a lot more reliable than dealing directly with OS processes like SPM does.

If I had to guess, I would be that Yue and I will/have both run into the same issues with the streamlit front-end and the new fragment feature that I expressed to you on Discord; essentially that there's there's not a good way to programmatically control just refreshing a part of your app when something changes on the backend, and therefore you end up having to either infinitely loop at the end of each script run OR periodically "poll" the backend state in order to see if something changed by rerunning the entire page from top to bottom.

Would definitely be interested to hear your experience, Yue! 👋

Yue1Harriet1 commented 2 weeks ago

yayyyyy! what you suggested totally worked for automatic updates @sfc-gh-jcarroll !! :D :D NIceeee , updated the layout_current_session_tasks function in ui_streamlit.py with "run_every" . Sure! would love to chat ! @sfc-gh-jcarroll 👍 :D 💯