Allow threading for sync `use_effect` calls
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by tracing how sync use_effect calls are handled alongside the ASGI websocket consumer and document the current main-thread behavior. Define whether the default should serialize effects through a single worker, how the proposed threading parameter restores legacy behavior, and whether configurable worker counts are in scope; done requires an agreed design and corresponding coverage.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Current Situation
Users frequently run into unexpected webserver "freezing" when using sync effects due to Python's single-threaded nature. This is seemingly caused by the ASGI websocket consumer being blocked from receiving/sending data during hook operations. This behavior doesn't seem to match up with equivalent JavaScript server side frameworks.
Proposed Actions
By default we should run all sync effects in a ThreadPoolExecutor(max_workers=1). This effectively runs all sync effects in a background thread. Additionally, by running all effects in the same worker thread (max_workers=1) this implementation is semi-threadsafe (as long as the user didn't start an operation outside of his use_effect call (which they shouldn't have under React-style programming). For operations that must run on the main thread, we need a @use_effect(threading: bool = ...) parameter to switch back to legacy behavior.
We could also consider a reactpy.config.USE_EFFECT_WORKERS=... setting to allow users to modify the value of max_workers.
- Lingua principale
- Python
- Stelle
- 8.1k
- Fork
- 332
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reactive-python/reactpy
-
Outdated GIF in Docs Apertapriority-3-low type-docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
reactive-python/reactpy#1034 ·
-
priority-2-moderate type-revision
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
reactive-python/reactpy#1319 ·
-
priority-1-high
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
reactive-python/reactpy#1277 ·
-
priority-3-low
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
reactive-python/reactpy#1273 · 1 reazione ·
-
priority-2-moderate
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
reactive-python/reactpy#1272 · 2 reazioni ·
Tutte le issue di reactive-python/reactpy
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
CSCfi/sd-search-api#39 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
please add to porn list Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
StevenBlack/hosts#3255 ·