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

Issue #289- eager eval of is async #384

Merged
merged 4 commits into from Aug 21, 2022
Merged

Conversation

Goldziher
Copy link
Contributor

This PR resolves #289 by adding an AsyncCallable wrapper. I then applied if everywhere we can pre-compute this.

Note- i removed the LifeCycleHook wrapper because it was redundant with this addition.

@Goldziher Goldziher changed the title Issue 289 eager eval of is async Issue #289- eager eval of is async Aug 20, 2022
@Goldziher Goldziher force-pushed the issue-289-eager-eval-of-is-async branch from 15b2f46 to 5d18017 Compare August 20, 2022 13:23
starlite/utils/sync.py Outdated Show resolved Hide resolved
starlite/utils/sync.py Outdated Show resolved Hide resolved
- makes `utils.predicates.is_async_callable()` a type guard
- makes `AsyncCallable` generic on `P` and `T`.
@sonarcloud
Copy link

sonarcloud bot commented Aug 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Goldziher Goldziher merged commit b9e9f23 into main Aug 21, 2022
@Goldziher Goldziher deleted the issue-289-eager-eval-of-is-async branch August 21, 2022 03:22
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.

Enhancement: Eager eval of async vs. sync guards
3 participants