You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we make that API match the one from st? That is, it would be great if methods from the mainDeltaGenerator were accessible as thread_safe_st.foo rather than from thread_safe_st.main.foo
Even better, can the user just pass the st object itself to the other thread? Why do we need ThreadSafeSt at all?
If it turns out that a ThreadSafeStis needed, we should come up with a better name for it. Something likeStreamlitContext sounds good to me, but we already have a ReportContext in our codebase, so it may be confusing. Maybe rename ReportContext in the process?
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.
The text was updated successfully, but these errors were encountered:
Seems like it's pretty straightforward to address point 2 by extending ThreadSafeSt like this:
class ThreadSafeSt():
# ... original class body
def __getitem__(self, item):
return self.main[item]
def __getattr__(self, item):
return getattr(self.main, item)
Haven't tested it extensively, but it seems to work well enough for my purposes!
See a possible solution here: https://gist.github.com/tvst/fa33b9dcb58040cbcb0ea376146d4e8c
and see https://discuss.streamlit.io/t/live-plot-from-a-thread/247 for context.
A few thoughts on that Gist:
st
? That is, it would be great if methods from themain
DeltaGenerator
were accessible asthread_safe_st.foo
rather than fromthread_safe_st.main.foo
st
object itself to the other thread? Why do we needThreadSafeSt
at all?ThreadSafeSt
is needed, we should come up with a better name for it. Something likeStreamlitContext
sounds good to me, but we already have aReportContext
in our codebase, so it may be confusing. Maybe renameReportContext
in the process?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.
The text was updated successfully, but these errors were encountered: