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

Asynchronous API #49

Open
neptunao opened this issue Feb 1, 2019 · 4 comments
Open

Asynchronous API #49

neptunao opened this issue Feb 1, 2019 · 4 comments

Comments

@neptunao
Copy link
Contributor

neptunao commented Feb 1, 2019

It would be really nice to have asynchronous API since this library provide an interface for network I/O. The best possible solution will be to target .NET >= 4.5 and use async/await pattern, but if it's not possible we can at least implement it using older patterns, as IAsyncResult.

@picrap
Copy link
Member

picrap commented Feb 1, 2019

Sure! However I don't want to drop .NET 4.0 compatibility for now and I still want the synchronous API side-by-side.
So maybe we could provide another assembly, specific to .NET 4.5 and .NET standard for async, based on a common IAsyncResult, as you suggested?

@picrap
Copy link
Member

picrap commented Feb 2, 2019

Digging further, we can probably add *Async methods with the current implementation so stay in .NET 4.0.

@neptunao
Copy link
Contributor Author

neptunao commented Feb 4, 2019

We can also include Async Targeting Pack, though I don't think that's a good idea. Probably the best way is to have IAsyncResult based approach in the main assembly, and have extension assembly for .NET >= 4.5 with Tasks from IAsyncResult.

@picrap
Copy link
Member

picrap commented Feb 4, 2019

There is probably no need to have a .NET 4.5 special assembly. If alternative methods return a Task or Task<>, it can be processed from a .NET 4.5 using async/await.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants