Page Refresh detection and data persistance between refresh page
Checklist
- [x] I have searched the existing issues for similar feature requests.
- [x] I added a descriptive title and summary to this issue.
Summary
Currently,
- There is no way to detect page refresh
- There is no way to persists data between page refresh
Why?
I want to open serial port manually and it should be keep opened serial port object, even user press page refresh button on browser. secondly it should close it on page exist.
How?
Currently i am using @st.cache_resource to open it by opening fixed serial port and close it using atexit.register(app_closed)
Additional Context
No response
To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.
Your vote helps us identify which enhancements matter most to our users.
This is very important. We have tried using threads to handle long running process. When the page refreshes, the thread is also killed. We thought of using a persistent websocket connection but I think one the page is refreshed, the http session is renewed.