You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to have an instance of HStream that allows to stream without using lazy I/O; in particular, an instance that would allow us to close the connection when we no longer want the rest of the response body.
However, in order to define a custom type with a corresponding HStream instance one needs to provide, amongst other things, implementations of
and there is a Stream instance for Connection, hstreamToConnection works only for HandleStream String, so that doesn't help either.
Finally, the HandleStream type is completely opaque (it does not even satisfy Functor) so we cannot define a HStream instance for one bufType in terms of the HStream instance for another. If we had some way of defining new instances in terms of old instances (for instance, reuse the instance for lazy bytestrings, but somehow retain a handle to the corresponding HandleStream so that we can close it explicitly) that would be great.
The text was updated successfully, but these errors were encountered:
It would be nice to be able to have an instance of
HStream
that allows to stream without using lazy I/O; in particular, an instance that would allow us to close the connection when we no longer want the rest of the response body.However, in order to define a custom type with a corresponding
HStream
instance one needs to provide, amongst other things, implementations ofFor the implementation of
openStream
we can useHowever, for the implementation of
close
we are stuck; there is no function analogous toopenTCPConnection
that allows us to close aHandleStream
.Although we have
and there is a
Stream
instance forConnection
,hstreamToConnection
works only forHandleStream String
, so that doesn't help either.Finally, the
HandleStream
type is completely opaque (it does not even satisfyFunctor
) so we cannot define aHStream
instance for onebufType
in terms of theHStream
instance for another. If we had some way of defining new instances in terms of old instances (for instance, reuse the instance for lazy bytestrings, but somehow retain a handle to the correspondingHandleStream
so that we can close it explicitly) that would be great.The text was updated successfully, but these errors were encountered: