Reputation: 78155
The WebApi's PushStreamContent
accepts an Action<>
or a Func<>
that is named "onStreamAvailable" and is supposed to be
called when an output stream is available, allowing the action to write to it directly.
Is that Action (or Func) guaranteed to be called?
In a situation where the user quickly closes the browser after clicking a link that starts streaming on the server, is it possible that the WebApi framework will not call the lambda at all?
Background: It would be very very convenient to pass a certain handle to the Action
, but it absolutely has to Close
it. In a situation where the lambda is not called at all, we would end up with a leaked handle.
Upvotes: 1
Views: 121