Python API reference
pipeline.input() | pipeline.sink()Input and Sink — Python Architecture DSL
Bind a stream graph to connector endpoints for inbound and outbound transport.
When to use
Use Input to admit endpoint messages and Sink to submit graph messages through an endpoint.
Behavior
- Input may define a primary source or sources for endpoint patterns that participate in a cycle.
- Sink may reference an error stream for failures returned by the transport adapter.
- Endpoint and value type compatibility is validated across all uses of an endpoint. Multiple independent Sink streams may share it, including within one service. Each Sink keeps its own consumer and result/error path; compatible request and response contracts are required across all callers.
- An endpoint may have at most one Input per service. Configure dedicated failure paths after construction with
stream.on_error(error_stream)orstream | error_stream, not anerror_stream=factory argument.
Pipeline.input() properties
Inbound boundary.
PropertyTypeDescription
namestrHuman-readable stream name; the symbolic key is derived automatically.
RequiredsourceStream | NoneOptional primary upstream stream.
Default:NoneappearanceAppearance | NoneOptional Designer coordinates and color supported by this entity.
Default:NoneendpointEndpointEndpoint consumed by the stream.
Requiredvalue_typeTypeDefinition | DataType | str | NoneOutput or boundary payload contract.
Default:NonesourcesSequence[Stream]Additional sources.
Default:()Pipeline.sink() properties
Outbound boundary.
PropertyTypeDescription
namestrHuman-readable stream name; the symbolic key is derived automatically.
RequiredsourceStream | NoneOptional primary upstream stream.
Default:NoneappearanceAppearance | NoneOptional Designer coordinates and color supported by this entity.
Default:NoneendpointEndpointEndpoint called or published to.
Requiredvalue_typeTypeDefinition | DataType | str | NoneOutput or boundary payload contract.
Default:NonePython example
consume = orders.input(
"Consume Orders", endpoint=order_topic, value_type=order
)
publish = orders.sink(
"Publish Result", endpoint=result_topic, value_type=order_result
)
consume >> publish