Pristine.RuntimeGateway behaviour (Pristine v0.4.0)

Copy Markdown View Source

HTTP-family execution boundary for explicit local or Runtime Client placement.

The gateway is deliberately not selected from application configuration. Callers choose a concrete implementation once for an operation and pass all placement material explicitly. This keeps local execution distinct from a Runtime Client-admitted effect.

Summary

Functions

The direct, same-node HTTP-family implementation.

The admitted Runtime Client implementation.

Callbacks

cancel(t, keyword)

@callback cancel(ExecutionPlane.ExecutionRef.t(), keyword()) :: :ok | {:error, term()}

demand(t, pos_integer, keyword)

@callback demand(ExecutionPlane.ExecutionRef.t(), pos_integer(), keyword()) ::
  :ok | {:error, term()}

status(t, keyword)

@callback status(ExecutionPlane.ExecutionRef.t(), keyword()) ::
  {:ok, ExecutionPlane.Runtime.Status.t()} | {:error, term()}

stream(t, pid, keyword)

@callback stream(ExecutionPlane.Family.HTTPRequest.t(), pid(), keyword()) ::
  {:ok, ExecutionPlane.ActiveExecution.t()} | {:error, term()}

unary(t, keyword)

@callback unary(ExecutionPlane.Family.HTTPRequest.t(), keyword()) ::
  {:ok, ExecutionPlane.ExecutionResult.t()} | {:error, term()}

Functions

local()

@spec local() :: module()

The direct, same-node HTTP-family implementation.

runtime_client()

@spec runtime_client() :: module()

The admitted Runtime Client implementation.

Its presence is not a capability advertisement. A caller must inject a configured Runtime Client and complete admission material for every effect.