OctopusDeploy / Halibut

| Public | A secure communication stack for .NET using JSON-RPC over SSL.
Other
12 stars 44 forks source link

Adds a async base stream #445

Closed LukeButters closed 1 year ago

LukeButters commented 1 year ago

Background

Creating streams that are actually async can be difficult, since it is not clear what methods need to be implemented. This PR adds a new AsyncStream which helps with that. The AsyncStream will force the required async methods to be implemented as well as take care of the old style async programming APM to also be async.

This PRs changes some classes (Not including NetworkTimeoutStream) to implement AsyncStream.

This PR makes use of the changes added in https://github.com/OctopusDeploy/Halibut/pull/437

[SC-57119]

Related to https://github.com/OctopusDeploy/Issues/issues/8266

Results

Appears to be no change since the APM stream was doing this work at just the right place. This change removes the need to wrap again and instead defaults our streams to be ones that work with async.

How to review this PR

Quality :heavy_check_mark:

Pre-requisites

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to Shortcut Story #57119: Make all streams async friendly / you can't mess it up.