Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data TimedOut = TimedOut
- type PingReply = (UTCTime, UTCTime, Either TimedOut (FrameHeader, FramePayload))
- ping :: Http2Client -> Int -> ByteString -> IO PingReply
- type StreamResult = (Either ErrorCode HeaderList, [Either ErrorCode ByteString])
- type StreamResponse = (HeaderList, ByteString)
- waitStream :: Http2Stream -> IncomingFlowControl -> IO StreamResult
- fromStreamResult :: StreamResult -> Either ErrorCode StreamResponse
- onPushPromise :: Http2Stream -> PushPromiseHandler -> IO ()
Documentation
Opaque type to express an action which timed out.
type PingReply = (UTCTime, UTCTime, Either TimedOut (FrameHeader, FramePayload)) Source #
Result for a ping
.
:: Http2Client | client connection |
-> Int | timeout in microseconds |
-> ByteString | 8-bytes message to uniquely identify the reply |
-> IO PingReply |
Performs a ping
and waits for a reply up to a given timeout (in
microseconds).
type StreamResult = (Either ErrorCode HeaderList, [Either ErrorCode ByteString]) Source #
Result containing the unpacked headers and all frames received in on a
stream. See StreamResponse
and fromStreamResult
to get a higher-level
utility.
type StreamResponse = (HeaderList, ByteString) Source #
An HTTP2 response, once fully received, is made of headers and a payload.
waitStream :: Http2Stream -> IncomingFlowControl -> IO StreamResult Source #
Wait for a stream until completion.
This function is fine if you don't want to consume results in chunks.
fromStreamResult :: StreamResult -> Either ErrorCode StreamResponse Source #
Converts a StreamResult to a StramResponse, stopping at the first error using the `Either HTTP2.ErrorCode` monad.
onPushPromise :: Http2Stream -> PushPromiseHandler -> IO () Source #
Sequentially wait for every push-promise with a handler.
This function runs forever and you should wrap it with withAsync
.