Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a new attempt at providing an
unmask
callback to streaming requests, replacing #77.As per the discussion in #77, I've new introduced
OutBodyStreamingUnmask
alongsideOutBodyStreaming
.This was actually a useful change. When I first wrote #77, I didn't really understand the server part of
http2
very well yet, as I had not yet implemented the server part of my gRPC library. I now have, and understand the server aspect ofhttp2
much better. My suspicion in #77 that I might have gotten the control flow wrong for the server API turned out to be correct: the point of this change is that user code gets control over when exceptions are unmasked in newly spawned threads. On the client side, that newly spawned thread is created insendRequest
(inNetwork.HTTP2.Client.Run
). On the server-side, however, this works a bit differently:http2
spawns a new thread for each incoming request (call tosetAction
inrun
,Network.HTTP2.Server.Run
); it then does not spawn a new thread for a streaming response body.Therefore, this PR only deals with the client side, and
OutBodyStreamingUnmask
is not actually supported at all on the server side (this PR introducesrequestStreamingUnmask
, without a correspondingresponseStreamingUnmask
). It might be useful to change theServer
type synonym so that theserver
action passed torun
would also be given anunmask
callback, but that has now become orthogonal to this PR.