This pull request updates the library to be fullly asynchronous, resolving issue #14. It also includes support for cancellation tokens requested in issue #6.
Notes:
This is a minor breaking change as I did not implement sync versions of the code due to the nature of the library and because it would require a significant amount of duplicative code. Generally speaking, I/O bound libraries like this should probably be async-only anyway.
I say "minor" because the interfaces are essentially the same with the exception of now having to await them. The cancellation token support is also optional.
Because it is "async all the way down," and the functions all return Tasks I didn't suffix the function names with "Async."
This update still utilizes WebRequest, which is not async friendly. In particular, WebRequest does not natively support task cancellation tokens, so an extension method is provided as an easy way to work around this limitation.
The unit tests are updated for async and all successful, but as (I think) async unit tests aren't fully supported, I simply waited the async calls for the time being.
There may be a need to make some additional code async, but the major culprits of network requests and memory copies are done and is probably "good enough"
I realize that this is a pretty significant update and you may want to hold off on it, but figured I would submit the pull request for your review whenever. Let me know if you'd like any changes.
A pull request to resolve issue #16, replacing WebRequest with HttpClient will come separately. That update will probably be dependent on this one as HttpClient is async friendly. I may make it a separate ISource so that you can use either WebRequest or HttpClient.
NOTE: I have a consolidated branch containing the SVG, Async and HttpClient pull requests into one if preferred. Since each PR is based off of the mainline, it does take a little work to combine them. Let me know
This pull request updates the library to be fullly asynchronous, resolving issue #14. It also includes support for cancellation tokens requested in issue #6.
Notes:
This is a minor breaking change as I did not implement sync versions of the code due to the nature of the library and because it would require a significant amount of duplicative code. Generally speaking, I/O bound libraries like this should probably be async-only anyway.
I say "minor" because the interfaces are essentially the same with the exception of now having to await them. The cancellation token support is also optional.
Because it is "async all the way down," and the functions all return Tasks I didn't suffix the function names with "Async."
This update still utilizes WebRequest, which is not async friendly. In particular, WebRequest does not natively support task cancellation tokens, so an extension method is provided as an easy way to work around this limitation.
The unit tests are updated for async and all successful, but as (I think) async unit tests aren't fully supported, I simply waited the async calls for the time being.
There may be a need to make some additional code async, but the major culprits of network requests and memory copies are done and is probably "good enough"
I realize that this is a pretty significant update and you may want to hold off on it, but figured I would submit the pull request for your review whenever. Let me know if you'd like any changes.
A pull request to resolve issue #16, replacing WebRequest with HttpClient will come separately. That update will probably be dependent on this one as HttpClient is async friendly. I may make it a separate ISource so that you can use either WebRequest or HttpClient.
NOTE: I have a consolidated branch containing the SVG, Async and HttpClient pull requests into one if preferred. Since each PR is based off of the mainline, it does take a little work to combine them. Let me know