ExecutionPlane.Protocols.JsonRpc.Adapter (execution_plane v0.1.0)

Copy Markdown View Source

Execution Plane-owned JSON-RPC framing adapter for persistent lanes.

Family kits keep protocol-session orchestration and provider semantics above this adapter while the canonical request/response framing and correlation live below them.

Summary

Types

t()

@type t() :: %ExecutionPlane.Protocols.JsonRpc.Adapter{
  next_id: non_neg_integer(),
  ready_matcher: (map() -> boolean()) | nil
}

Functions

encode_notification(notification, state)

@spec encode_notification(term(), t()) :: {:ok, binary(), t()} | {:error, term()}

encode_once(request)

@spec encode_once(term()) :: binary()

encode_peer_reply(correlation_key, arg, state)

@spec encode_peer_reply(term(), {:ok, term()} | {:error, term()}, t()) ::
  {:ok, binary(), t()}

encode_request(request, state)

@spec encode_request(term(), t()) :: {:ok, term(), binary(), t()} | {:error, term()}

handle_inbound(frame, state)

@spec handle_inbound(binary(), t()) :: {:ok, [term()], t()}

init(opts)

@spec init(keyword()) :: {:ok, t(), [binary()]}