question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rerun when file system/database/some other external data source changes

See original GitHub issue

This is an issue to cover the topics not addressed within PR https://github.com/streamlit/streamlit/pull/2060 that were raised within the issue https://github.com/streamlit/streamlit/issues/653.

Below are copied in some key comments


The key goals personally for an API that is able to rerun when an external data source changes are listed below:

_Originally posted by @SimonBiggs in https://github.com/streamlit/streamlit/pull/2060#issuecomment-704016152_


Is there a way to get the current session from within a watchdog thread? For example, see the following use case:

After you create a thread (but before you start it), you can call report_thread.add_report_ctx(...) to attach a ReportContext object (which contains the session_id) to that thread.

Of course, this requires that thread creation be under your control - which (I think?) does not apply for watchdog.

What I’d suggest in this situation - with the caveat that it’s been a while since I looked at this code - is to create a separate thread (with the ReportContext attached) that simply handles watchdog file-changed events that are raised from within the watchdog thread. (You’ll need to set up some method of communicating between the two threads, like a thread safe queue or something.)

Does that make sense, and is it possible for your use case?

_Originally posted by @tconkling in https://github.com/streamlit/streamlit/pull/2060#issuecomment-703945085_


Some ideas for various possible APIs:

https://github.com/streamlit/streamlit/issues/653#issuecomment-679853730

and

  • st.experimental_directory_tree('path/to/directory', recursive=False)

https://github.com/streamlit/streamlit/issues/653#issuecomment-680423424

_Originally posted by @SimonBiggs in https://github.com/streamlit/streamlit/pull/2060#issuecomment-703901760_



Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
firlacommented, Nov 11, 2022

Anyone? Thx

1reaction
firlacommented, Oct 4, 2022

Hi. I am currently researching web app frameworks for a new project, so I am new to the topic. Streamlit sounds wonderful and is currently my favorite. However, I absolutely need the “rerun when database (redis keys) changes” feature. I have read #2060 and #2180, but I am not yet sure if the feature is available (per st.experimental_rerun).

Thank you for a brief info or links to related documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Refresh an external data connection in Excel - Microsoft Support
Select a cell in the external data range. Select Data > Queries & Connections > Connections tab, right click a query in the...
Read more >
Refresh Data Sources - Tableau Help
Refreshing an extract will query the data source the extract was created from and rebuild the extract. This process might take some time,...
Read more >
Replaying a Database Workload - Oracle Help Center
After a captured workload is preprocessed, it can be replayed repeatedly on a replay system that is running the same version of Oracle...
Read more >
Change Data Capture (CDC): What it is and How it Works
Log-Based Change Data Capture ... Databases contain transaction logs (also called redo logs) that store all database events allowing for the database to...
Read more >
IBM Informix Messages and Corrections
The database server did not find any more data. ... Remount the file system to your workstation and rerun your application. -71 Too...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found