streamlit / docs

Source code for the Streamlit Python library documentation
https://docs.streamlit.io
Apache License 2.0
119 stars 479 forks source link

add doc to explain multithreading #1154

Open jokester opened 1 month ago

jokester commented 1 month ago

Warning for interested

This PR likely requires major change before merged, if it ever will. The patterns mentioned should mostly work for current Streamlit, but the official team has the decide to how to introduce them.

πŸ“š Context

Surprising many people are confused by multithreading in Streamlit, like in https://github.com/streamlit/docs/issues/87 / https://github.com/streamlit/streamlit/issues/1326 / https://github.com/streamlit/streamlit/issues/8490 .

This PR tries to explain the underneath Streamlit-specific things, and provide multithreading patterns to start with.

🧠 Description of Changes

Revised:

see the new file

Current:

(I didn't find document explaining threads and ScriptRunContext, except in the code)

πŸ’₯ Impact

Size:

🌐 References

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

jokester commented 1 month ago

I'm happy to hear feedback about content or format :pray:

jokester commented 1 month ago

CI fails but I can't find the error message. The links like https://app.netlify.com/sites/streamlit-docs/deploys/66eaa4a1b1871d000843e854 only says "A fatal rendering error has occurred"

sfc-gh-dmatthews commented 1 month ago

Hi @jokester. Thanks for contributing. The site won't build and the page won't be viewable without correctly updating site navigation. Check out the readme file for docs, specifically Add pages to the menu.

I'm going over items for the next release right now, so it might take me a few weeks to look at this more closely. Multithreading has been on my list for a while, so thanks for taking a stab at it. I'll circle back here when I get the next release fleshed out. πŸ˜„

jokester commented 1 month ago

@sfc-gh-dmatthews Thanks !! I managed to get preview build to work https://deploy-preview-1154--streamlit-docs.netlify.app/develop/concepts/architecture/threading