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

Cleanup: Consider unifying sync and async code paths #10902

Closed
anpete opened this issue Feb 7, 2018 · 3 comments
Closed

Cleanup: Consider unifying sync and async code paths #10902

anpete opened this issue Feb 7, 2018 · 3 comments
Assignees
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.

Comments

@anpete
Copy link
Contributor

anpete commented Feb 7, 2018

Using the pattern where we use async methods all the way down, but pass a flag that controls whether the actual I/O operation is performed asynchronously. See Npgsql for example.

@ajcvickers ajcvickers added this to the Backlog milestone Feb 13, 2018
@AndriySvyryd
Copy link
Member

@smitpatel not needed?

@smitpatel
Copy link
Member

I don't remember what was basic idea was before. But this is what current mechanism in place.

  • Query Compilation is agnostic to sync/async except
    • Generating final QueryingEnumerable which would be used to enumerate database result
    • Reducing cardinality of result on client side when final result is not enumerable
  • Shaper is also sync agnostic. We only use sync/async to read row from database side in particular mode. And of course the cancellation token for async enumeration.

If there is anything else we can do and should do then we can update description accordingly. Nothing specific comes to my mind. Up to @AndriySvyryd and @roji

@roji
Copy link
Member

roji commented Aug 22, 2019

We still have quite a few places in EF (outside query compilation) where we have code duplication for sync/async, I think there's value in doing this - unless there are objections.

One theoretical issue is that this introduces a slight CPU perf hit on the sync path because methods are now async, i.e. have a state machine, even if they always complete synchronously. That's likely to be completely negligible though.

@ajcvickers ajcvickers modified the milestones: Backlog, MQ Sep 11, 2020
@ajcvickers ajcvickers removed this from the MQ milestone Jan 21, 2022
@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Jan 21, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed.
Projects
None yet
Development

No branches or pull requests

6 participants