Hermes.Transport.Behaviour behaviour (hermes_mcp v0.2.2)

Defines the behavior that all transport implementations must follow.

Summary

Types

message()

@type message() :: String.t()

reason()

@type reason() :: term()

t()

@type t() :: pid() | module()

Callbacks

send_message(message)

(optional)
@callback send_message(message()) :: :ok | {:error, reason()}

send_message(t, message)

@callback send_message(t(), message()) :: :ok | {:error, reason()}

shutdown(t)

@callback shutdown(t()) :: :ok | {:error, reason()}

start_link(keyword)

@callback start_link(keyword()) :: Supervisor.on_start()