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

Runtime values and outputs

Core TypeScript 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
MessageContextPer-message context

Carries cancellation, stream ID, priority, and tracing propagation. Pass the same context to outputs unless intentionally deriving another context.

StreamStream metadata

Exposes generated stream identity, configuration, type, environment, and runtime bindings.

Collector<T>Operator output

out(context, value) forwards a value and returns void or a completion Promise.

StreamContext<T, R, E>Source endpoint context

collect(context, value) and errorCollect(context, error) emit into the graph.

SinkStreamContext<T, R, E>Sink endpoint context

Collects typed outbound results and errors.

KeyValue<K, V>Keyed value

Carries key and value from keyBy into stateful joins.

RuntimeEnvironmentMaker dependency

Provides metrics, logger, tracing, runtime configuration, and service dependencies.

<Type>StreamConfig / <Type>EndpointConfigTyped configuration

Generated type imports make the maker contract specific to the selected graph node.

Generated extension pattern

await stream.collect(context, value);
await stream.errorCollect(context, error);
await out.out(context, result);