Works towards solving #40, allowing read and write halves to work independently. Maintains the old API for compatibility.
This is a pre-factoring PR that splits out a ReadHalf and WriteHalf, and ensures that you can read and write independently. A later PR will build on this to create the split API.
The main parts of this PR are:
A new Fragments struct that collects Frames.
The split ReadHalf and WriteHalf that do not contain a stream, allowing us to drive reads and writes externally
Reads provide an 'obligated write' which the caller is required to send
I tried to avoid making any major logic changes to functions -- this is mainly moving things around for a later patch.
Also note that the logic around checking whether the WriteHalf is closed or not has been hoisted into the read callers. This is a little awkward given that there is a fragmented and non-fragmented read path that duplicate this logic, but we may be able to clean this up in the future.
Works towards solving #40, allowing read and write halves to work independently. Maintains the old API for compatibility.
This is a pre-factoring PR that splits out a
ReadHalf
andWriteHalf
, and ensures that you can read and write independently. A later PR will build on this to create the split API.The main parts of this PR are:
Fragments
struct that collectsFrame
s.ReadHalf
andWriteHalf
that do not contain a stream, allowing us to drive reads and writes externallyI tried to avoid making any major logic changes to functions -- this is mainly moving things around for a later patch.
Also note that the logic around checking whether the
WriteHalf
is closed or not has been hoisted into theread
callers. This is a little awkward given that there is a fragmented and non-fragmented read path that duplicate this logic, but we may be able to clean this up in the future.