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
Users frequently run into unexpected webserver "freezing" when using sync effects due to Python's single-threaded nature. 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. 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.
The text was updated successfully, but these errors were encountered:
Current Situation
Users frequently run into unexpected webserver "freezing" when using sync effects due to Python's single-threaded nature. 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. 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 ofmax_workers
.The text was updated successfully, but these errors were encountered: