ExecutionPlane.Protocols.HTTP (ExecutionPlaneHttp v0.2.0)

Copy Markdown View Source

Minimal unary HTTP execution for the lower substrate.

The ordinary execute/2 path remains synchronous from the caller's point of view. start_request/6 and cancel_request/1 expose the lower :httpc primitives needed by ExecutionPlane.HTTP.start_unary/2 without introducing a second HTTP client or bypassing the kernel lifecycle.

Summary

Types

request_id()

@type request_id() :: term()

Functions

cancel_request(request_id)

@spec cancel_request(request_id() | nil) :: :ok

Cancels an active :httpc request.

Cancellation is physical lower-transport cancellation; it delegates to :httpc.cancel_request/1 rather than merely abandoning a waiter. As with the underlying OTP API, a response that completed concurrently may already be in the receiver mailbox, so the caller still owns terminal race resolution.

execute(dispatch_plan, opts)

@spec execute(ExecutionPlane.Kernel.DispatchPlan.t(), keyword()) ::
  {:ok, map()} | {:error, map()}

protocol()

@spec protocol() :: String.t()

start_request(method, url, headers, content_type, body, timeout_ms)

@spec start_request(atom(), String.t(), list(), String.t(), iodata(), pos_integer()) ::
  {:ok, request_id()} | {:error, term()}

Starts a real asynchronous :httpc request owned by the calling process.

The returned request identifier is the lower transport handle used by cancel_request/1. Completion is delivered to the caller as the standard {:http, {request_id, response}} message from :httpc.

supported_stream_modes()

@spec supported_stream_modes() :: [String.t(), ...]

supports_intent?(arg1)

@spec supports_intent?(struct() | map() | keyword()) :: boolean()