Context + Stream + Collector + EnvironmentRuntime 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.
servicelib::MessageContextPer-message contextCarries correlation and propagation state across Asio work. Preserve it when emitting outputs.
servicelib::ContextLifecycle contextPassed to makers and service lifecycle operations.
servicelib::StreamBaseStream metadataIdentifies the generated stream invoking the callable.
Output / ErrorOutputCallable outputsCall out(context, value) or .out(context, value) according to the generated signature.
servicelib::Payload<T>Shared payloadKeeps typed data alive while asynchronous consumers execute.
servicelib::SourceStreamContext<T, R, E>Source endpoint contextcollect and collectError enter the graph.
servicelib::SinkStreamContext<T, R, E>Sink endpoint contextcollect and collectError emit outbound results.
servicelib::BeginResult<State>Endpoint begin resultPairs the propagated context with state for the interaction.
servicelib::IServiceEnvironmentMaker dependencyProvides configuration and observability services during construction.
Generated extension pattern
stream.collect(std::move(context), std::move(value));
stream.collectError(std::move(context), error);