http2-client- A native HTTP2 client library.

Safe HaskellNone




data TimedOut Source #

Opaque type to express an action which timed out.



ping Source #


:: 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.