SAService Architect Back to designer
SAService ArchitectDocumentation
Framework reference Context + Stream + Collector + Environment

Runtime values and outputs

Core C++ Boost values passed into makers, operators, and endpoint handlers. These are the stable application-facing handles to the generated runtime.

When to use

Use this page while implementing a generated business function or endpoint handler.

Behavior

  • Contexts carry cancellation and correlation across graph boundaries.
  • Collectors and stream contexts are the supported way to emit values; calling downstream functions directly bypasses graph semantics and observability.
  • The service environment is supplied during construction so business implementations can create scoped metrics, obtain loggers, and resolve configured dependencies.

Core runtime types

Types normally visible in preserved implementation signatures.

Type or methodRoleDescription
servicelib::MessageContextPer-message context

Carries correlation and propagation state across Asio work. Preserve it when emitting outputs.

servicelib::ContextLifecycle context

Passed to makers and service lifecycle operations.

servicelib::StreamBaseStream metadata

Identifies the generated stream invoking the callable.

Output / ErrorOutputCallable outputs

Call out(context, value) or .out(context, value) according to the generated signature.

servicelib::Payload<T>Shared payload

Keeps typed data alive while asynchronous consumers execute.

servicelib::SourceStreamContext<T, R, E>Source endpoint context

collect and collectError enter the graph.

servicelib::SinkStreamContext<T, R, E>Sink endpoint context

collect and collectError emit outbound results.

servicelib::BeginResult<State>Endpoint begin result

Pairs the propagated context with state for the interaction.

servicelib::IServiceEnvironmentMaker dependency

Provides configuration and observability services during construction.

Generated extension pattern

stream.collect(std::move(context), std::move(value));
stream.collectError(std::move(context), error);