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

Remove fake async-over-sync extensions #262

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

adschmu
Copy link
Contributor

@adschmu adschmu commented Jul 8, 2024

Using async-over-sync is generally considered bad practice and discouraged for libraries. It makes the user think he gets actual async behavior while the only thing he actually gets is the overhead of a useless Task.

Since we already have the proper behavior for IQueryable in the project X.PagedList.EF, users should either use sync methods or reference the named package for real async implementation.

There is absolutely no point in using the async-over-sync variants. This only
makes things slower and blocks additional threads without providing any benefit
at all.

Note that X.PagedList.EF does not yet have tests, but implementing async tests for proper IQueryable is a little bit more complicated than just wrapping IEnumerable. This should be done in a future commit.

@adschmu adschmu force-pushed the pr/remove-async branch 2 times, most recently from 4f3573d to 16bd66e Compare July 10, 2024 08:57
@adschmu

This comment was marked as outdated.

Using async-over-sync is generally considered bad practice and discouraged for
libraries. It makes the user think he gets actual async behavior while the
only thing he actually gets is the overhead of a useless Task.

Since we already have the proper behavior for IQueryable in the project
X.PagedList.EF, users should either use sync methods or reference the
named package for real async implementation.

There is absolutely no point in using the async-over-sync variants. This only
makes things slower and blocks additional threads without providing any benefit
at all.

Note that X.PagedList.EF does not yet have tests, but implementing async tests
for proper IQueryable is a little bit more complicated than just wrapping
IEnumerable. This should be done in a future commit.
@a-gubskiy a-gubskiy merged commit 6ac9afe into dncuug:master Jul 10, 2024
2 checks passed
@adschmu adschmu deleted the pr/remove-async branch July 10, 2024 13:21
@triforcely triforcely mentioned this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants