Mimir.RouterClient behaviour (Mimir v0.1.0)

Copy Markdown View Source

Behaviour for routing oracle clients. This package ships one implementation:

  • Mimir.RouterClient.HTTP — Req-based POST to /v1/route. Use from external services or when process isolation is required.

An embedder that runs in the same application as the router (e.g. an in-process pipeline in a gateway, no HTTP hop) may implement this behaviour with its own in-process client instead. Any conforming implementation should return IDENTICAL atom-keyed response shapes for identical logical inputs.

Summary

Callbacks

Route a workload descriptor.

Callbacks

route(map, keyword)

@callback route(
  map(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Route a workload descriptor.

  • request — map with descriptor fields (see Mimir.Descriptor.parse/1). May include workflow_id, step_id, parent_step_id correlation ids.
  • opts — implementation-specific options, e.g. for HTTP: :base_url (required), :bearer_token (required).

Returns {:ok, response_map} with atom keys on success, or {:error, term()}.