-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ENG-4326] Async ComputedVar #4711
Conversation
simplify fetching of states and avoid repeatedly fetching the same state
Allow var dependencies to be added at runtime, for example, when defining a ComponentState that depends on vars that cannot be known statically. Fix more pyright issues.
these might be added dynamically later in which case we recompute the dependency tracking dicts... if not, they'll blow up anyway at runtime.
except RuntimeError: | ||
pass | ||
else: | ||
if is_in_app_harness(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to abstract this logic beyond being specific to app harness? is it possible to detect that an event loop running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's possible to detect it (which is what we're doing just above), but that would be abnormal conditions for a reflex app outside of a testing environment, so maybe we want to fail on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an error sounds fine then, if someone complains we will learn something 🤓
CodSpeed Performance ReportMerging #4711 will not alter performanceComparing Summary
|
rx.var
can now decorate anasync
function (Accessing the var on the instance requiresawait
)_var_dependencies
on other statesStateManagerRedis
get_state
routine to accomodate fetching of arbitrary state dependenciesget_state
method..add_dependency
onComputedVar
to allow compile time dynamic dependency specificationFixes #4022