ankh v0.0.4 Ankh.Connection

Genserver implementing HTTP/2 connection management

Ankh.Connection establishes the TLS underlying connection and provides connection and stream management, it also does frame (de)serialization and reassembly as needed.

Summary

Functions

Closes the connection

Sends a frame over the connection

Start the connection process for the specified URI

Functions

close(pid)

Specs

close(pid) :: :closed

Closes the connection

Before closing the TLS connection a GOAWAY frame is sent to the peer.

Parameters:

send(connection, frame)

Specs

send(pid | :atom, Ankh.Frame.t) ::
  :ok |
  {:error, atom}

Sends a frame over the connection

Parameters:

start_link(list, options \\ [])

Specs

start_link([uri: URI, receiver: pid | nil, stream: boolean, ssl_options: Keyword.t], GenServer.option) :: GenServer.on_start

Start the connection process for the specified URI.

Parameters:

  • args

    • uri: at least scheme and authority must be present.
    • receiver: pid of the process to send response messages to. Messages are shipped to the calling process if nil.
    • stream: if true, stream received data frames back to the receiver, else reassemble and send complete responses.
    • ssl_options: SSL connection options, for the Erlang :ssl module
  • options: GenServer startup options