ankh v0.8.0 Ankh.Protocol behaviour

Protocol behavior

Link to this section Summary

Types

Protocol options

Request reference

t()

Ankh protocol

Callbacks

Accepts a client connection

Closes the connection

Connects to an host

Reports a connection error

Creates a new connection

Sends a request

Handles transport messages

Link to this section Types

Link to this type

options()

options() :: Keyword.t()

Protocol options

Link to this type

request_ref()

request_ref() :: reference()

Request reference

Ankh protocol

Link to this section Callbacks

Link to this callback

accept(t, arg2, arg3, arg4)

accept(t(), URI.t(), Ankh.Transport.t(), Ankh.Transport.options()) ::
  {:ok, t()} | {:error, any()}

Accepts a client connection

Link to this callback

close(t)

close(t()) :: :ok | {:error, any()}

Closes the connection

Link to this callback

connect(t, arg2, arg3)

connect(t(), URI.t(), Ankh.Transport.options()) :: {:ok, t()} | {:error, any()}

Connects to an host

Link to this callback

error(t)

error(t()) :: {:ok, t()}

Reports a connection error

Link to this callback

new(options)

new(options()) :: t()

Creates a new connection

Link to this callback

request(t, arg2)

request(t(), Ankh.HTTP.Request.t()) ::
  {:ok, t(), request_ref()} | {:error, any()}

Sends a request

Link to this callback

respond(t, request_ref, arg3)

respond(t(), request_ref(), Ankh.HTTP.Response.t()) ::
  {:ok, t()} | {:error, any()}

Sends a response

Link to this callback

stream(t, any)

stream(t(), any()) :: {:ok, binary(), t()} | {:error, any()}

Handles transport messages