Skip to main content

build_timeout_response_message

Function build_timeout_response_message 

Source
pub fn build_timeout_response_message(
    runtime: &str,
    correlation_id: &str,
    tenant: &str,
    env: &str,
    deadline_ms: u64,
) -> (String, HeaderMap, Vec<u8>)
Expand description

Build the subject, headers, and serialized body for a timeout error response.

This is a pure function (no I/O) that constructs the message a spawned timeout task should publish when deadline_ms elapses before the real runtime responds.

§Parameters

  • runtime - the runtime name (e.g. "sorla")
  • correlation_id - echoed verbatim in the Greentic-Correlation-Id header
  • tenant - echoed in Greentic-Tenant
  • env - echoed in Greentic-Env
  • deadline_ms - the timeout that expired; used in the error message

§Returns

A tuple of (subject, headers, body_bytes) ready to pass to async_nats::Client::publish_with_headers.