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

Any reason for the async API? #10

Open
natalie-o-perret opened this issue Jul 5, 2021 · 4 comments
Open

Any reason for the async API? #10

natalie-o-perret opened this issue Jul 5, 2021 · 4 comments

Comments

@natalie-o-perret
Copy link

Hi,

Is there any reason for the the async API when it just tosses the job on the default scheduler?

I mean it doesn't saved any thread while it could based on the inherent IO latency.

@ume05rw
Copy link
Owner

ume05rw commented Jul 5, 2021

It's simple, I want to run queries in parallel.
Anyway, pull requests are welcome!

@natalie-o-perret
Copy link
Author

I mean this can be a bit misleading, considering that in most libraries users usually expect Async versions of methods to help you to save up some threads by leveraging the inherent latency of IO / network.

If would be better to provide synchronous vers and let the users decide whether they want things in parallel or not. Wdyt?

Afaik, Task.Run is usually for consumer code, not libraries.

@ume05rw
Copy link
Owner

ume05rw commented Jul 5, 2021

save up some threads by leveraging the inherent latency of IO / network.

Is there an implementation somewhere I can refer to?

@natalie-o-perret
Copy link
Author

save up some threads by leveraging the inherent latency of IO / network.

Is there an implementation somewhere I can refer to?

https://blog.stephencleary.com/2013/11/there-is-no-thread.html

Will try to find a ref. implementation for you (when my schedule will allow it).

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

No branches or pull requests

2 participants