flowno.core.streaming_node
Type definitions for streaming nodes in Flowno’s typechecking system.
A Streaming Node is a node that yields multiple values via async generator rather than returning a single value or tuple. This module defines Protocol classes that improve typechecking specificity for different node arities.
Warning
These classes are never instantiated directly - they exist solely for static type checking.
Naming Conventions
StreamingNode: Base protocol for all streaming nodes regardless of arity
StreamingNodeX: Node with X inputs that streams any number of outputs
StreamingNodeX_Y: Node with X inputs that streams Y outputs
See also
flowno.core.mono_node
: Type definitions for mono nodes
- class flowno.core.streaming_node.StreamingDraftOutputPortRef(node: DraftNode[Unpack, tuple[object, ...]], port_index: OutputPortIndex)[source]
Bases:
DraftOutputPortRef
[_Tout
]
- class flowno.core.streaming_node.StreamingNode(*args: Unpack)[source]
Bases:
Protocol
[Unpack
[_Ts
],_ReturnTupleT_co
]Protocol for streaming nodes that produce async generators of tuples.
A streaming node is a node that yields multiple values via async generator rather than returning a single value or tuple. This class serves as the base Protocol for all streaming node arities.
Note: This class is never instantiated - it exists solely for typechecking.
- class flowno.core.streaming_node.StreamingNode0[source]
Bases:
DraftNode
[_ReturnTupleT_co
]A streaming node with 0 inputs that yields tuples.
See StreamingNode for details on the streaming node protocol.
- class flowno.core.streaming_node.StreamingNode0_0[source]
Bases:
StreamingNode0
[tuple
[None
]],ABC
A streaming node with 0 inputs and 0 outputs.
See StreamingNode for details on the streaming node protocol.
- class flowno.core.streaming_node.StreamingNode0_1[source]
Bases:
StreamingNode0
[tuple
[_T1_co
]],ABC
A streaming node with 0 inputs and 1 output.
See StreamingNode for details on the streaming node protocol.
- class flowno.core.streaming_node.StreamingNode1(*args: Any)[source]
Bases:
DraftNode
[_T1_contra
,_ReturnTupleT_co
]A streaming node with 1 input that yields tuples.
See StreamingNode for details on the streaming node protocol.
- class flowno.core.streaming_node.StreamingNode2[source]
Bases:
DraftNode
[_T1_contra
,_T2_contra
,_ReturnTupleT_co
]A streaming node with 2 inputs that yields tuples.
See StreamingNode for details on the streaming node protocol.
- class flowno.core.streaming_node._ReturnTupleT_co
Type variable for the yielded tuple type of a streaming node.
alias of TypeVar(‘_ReturnTupleT_co’, bound=
tuple
[object
, …], covariant=True)
- flowno.core.streaming_node._Ts = _Ts
Type variable for the input types of a streaming node.