Python API reference
pipeline.input() | pipeline.sink()Input and Sink
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.
Pipeline.input() properties
Inbound boundary.
PropertyTypeDescription
namestrHuman-readable stream name; the symbolic key is derived automatically.
RequiredsourceStream | NoneOptional primary upstream stream.
Default:Nonex / yfloatDesigner canvas coordinates.
Default:0 / 0endpointEndpointEndpoint 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:Nonex / yfloatDesigner canvas coordinates.
Default:0 / 0endpointEndpointEndpoint called or published to.
Requiredvalue_typeTypeDefinition | DataType | str | NoneOutput or boundary payload contract.
Default:Noneerror_streamstr | NoneSymbolic failure consumer reference.
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