reflex/reflex
Thomas Brandého 956a526b20
add support for lifespan tasks (#3312)
* add support for lifespan tasks

* allow passing args to lifespan task

* add message to the cancel call

* allow asynccontextmanager as lifespan tasks

* Fix integration.utils.SessionStorage

Previously the SessionStorage util was just looking in localStorage, but the
tests didn't catch it because they were asserting the token was not None,
rather than asserting it was truthy.

Fixed here, because I'm using this structure in the new lifespan test.

* If the lifespan task or context takes "app" parameter, pass the FastAPI instance.

* test_lifespan: end to end test for register_lifespan_task

* In py3.8, Task.cancel takes no args

* test_lifespan: use polling to make the test more robust

Fix CI failure

* Do not allow task_args for better composability

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
2024-05-22 12:07:03 -07:00
..
.templates Support replacing route on redirect (#3072) 2024-05-16 13:21:40 -07:00
compiler [REF-2764] dep update 0.5.0 (#3245) 2024-05-07 15:15:52 -07:00
components add style for orientation=vertical in tabs (#3332) 2024-05-21 16:21:46 -07:00
constants [REF-2787] add_hooks supports Var-wrapped hooks (#3248) 2024-05-15 14:59:45 -07:00
custom_components Use twine environment variables if set (#3353) 2024-05-21 14:43:49 -07:00
experimental add style for orientation=vertical in tabs (#3332) 2024-05-21 16:21:46 -07:00
middleware feat: Synchronizing localStorage between tabs using browser events (#2533) 2024-02-20 15:14:55 -08:00
utils Added config for number of gunicorn workers (#3351) 2024-05-22 11:31:15 -07:00
__init__.py Radix 3.0 tweaks (#3257) 2024-05-08 14:02:37 -07:00
__init__.pyi Radix 3.0 tweaks (#3257) 2024-05-08 14:02:37 -07:00
__main__.py add __main__ entry point to allow python -m reflex (#1516) 2023-08-03 14:26:50 -07:00
admin.py Allow view overrides for registering models with admin (#1249) 2023-06-27 14:08:09 -07:00
app_module_for_backend.py Catch more errors in frontend/backend (#3346) 2024-05-20 16:55:41 -07:00
app.py add support for lifespan tasks (#3312) 2024-05-22 12:07:03 -07:00
base.py [REF-2774] Add ReflexError and subclasses, send in telemetry (#3271) 2024-05-10 12:12:42 -07:00
config.py Added config for number of gunicorn workers (#3351) 2024-05-22 11:31:15 -07:00
config.pyi Added config for number of gunicorn workers (#3351) 2024-05-22 11:31:15 -07:00
event.py Support replacing route on redirect (#3072) 2024-05-16 13:21:40 -07:00
model.py [REF-2764] dep update 0.5.0 (#3245) 2024-05-07 15:15:52 -07:00
page.py separate DECORATED_PAGES per reflex app (#3102) 2024-04-22 11:32:31 -07:00
reflex.py Clean up config and app API (#3197) 2024-05-02 18:15:28 -07:00
route.py [REF-2643] Throw Errors for duplicate Routes (#3155) 2024-05-03 12:15:40 -07:00
state.py Catch more errors in frontend/backend (#3346) 2024-05-20 16:55:41 -07:00
style.py [REF-2787] add_hooks supports Var-wrapped hooks (#3248) 2024-05-15 14:59:45 -07:00
testing.py allow passing kwargs and options to selenium webdriver (#2894) 2024-05-15 11:58:10 -07:00
vars.py do not check attribute type for var internals (#3357) 2024-05-22 11:35:42 -07:00
vars.pyi properly replace ComputedVars (#3254) 2024-05-15 15:01:14 -07:00