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

Runtime values and outputs

Core Python 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
StreamStream metadata

Provides the generated stream identity, configuration, environment, type information, and runtime binding.

Collect[T]Operator output

await out.out(value) forwards one value. Python operator callbacks do not receive the message context directly; the runtime preserves it around the async call.

StreamContext[T, R, E]Source endpoint context

await collect(value) emits input and await error_collect(error) emits a typed endpoint failure.

SinkStreamContext[T, R, E]Sink endpoint context

Emits decoded endpoint results and errors from outbound operations.

KeyValue[K, V]Keyed value

Output of key_by and input to stateful joins.

ContextMaker/lifecycle context

Carries cancellation and lifecycle state during construction; it is not an extra operator callback argument.

ServiceEnvironmentMaker dependency

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

<Type>StreamConfig / <Type>EndpointConfigTyped configuration

The generated maker annotation identifies the exact stream or endpoint configuration object.

Generated extension pattern

await sc.collect(value)
await sc.error_collect(error)
await out.out(result)