MLLP.ClientContract behaviour (mllp v0.9.4)

MLLP.ClientContract provides the behavior implemented by MLLP.Client. It may be useful for testing in your own application with tools such as Mox

Link to this section Summary

Link to this section Types

Link to this type

client_error()

Specs

client_error() :: MLLP.Client.Error.t()
Link to this type

error_reason()

Specs

error_reason() :: :closed | :timeout | :no_socket | :inet.posix()
Link to this type

error_type()

Specs

error_type() :: :tcp_error | :send_error | :recv_error

Specs

options() :: [
  auto_reconnect_interval: non_neg_integer(),
  use_backoff: boolean(),
  backoff_max_seconds: integer(),
  reply_timeout: non_neg_integer() | :infinity,
  socket_opts: [:gen_tcp.option()],
  telemetry_module: nil,
  close_on_recv_error: boolean(),
  tls: [:ssl.tls_client_option()]
]
Link to this type

send_options()

Specs

send_options() :: %{optional(:reply_timeout) => non_neg_integer() | :infinity}

Link to this section Callbacks

Link to this callback

send( pid, payload, options, timeout )

Specs

send(
  pid :: pid(),
  payload :: HL7.Message.t() | String.t(),
  options :: send_options(),
  timeout :: non_neg_integer() | :infinity
) ::
  {:ok, String.t()}
  | MLLP.Ack.ack_verification_result()
  | {:error, client_error()}
Link to this callback

send_async( pid, payload, timeout )

Specs

send_async(
  pid :: pid(),
  payload :: HL7.Message.t() | String.t(),
  timeout :: non_neg_integer() | :infinity
) :: {:ok, :sent} | {:error, client_error()}