Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF-2172] Add DECORATED_PAGES before compiling in thread #2841

Merged
merged 7 commits into from Mar 12, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Mar 12, 2024

py38 and py39 cannot get asyncio.Lock() instances in a thread that has no event loop running, so if a decorated page (@rx.page) depends on state, it needs to be added to the app in the MainThread and trigger the redis connection in the that thread.

Since compile_ now happens in a separate thread, reflex cannot safely add decorated pages during compile_.

This PR is based on #2839 to get CI coverage for py3.8 in the integration tests. That PR will fail... and this PR will fix it!

py38 and py39 cannot get asyncio.Lock() instances in a thread that has
no event loop running, so if a decorated page (@rx.page) depends on state,
it needs to be added to the app in the MainThread and trigger the
redis connection in the that thread.

Since compile_ now happens in a separate thread, reflex cannot safely
add decorated pages during compile_.
@picklelo picklelo merged commit eb18ce9 into main Mar 12, 2024
47 checks passed
@masenf masenf deleted the masenf/fix-py38-redis-page-dec branch April 24, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants