flowno.decorators.node_meta_single_dec
Node meta decoration for single-output Flowno nodes.
This module provides the node_meta_single_dec class, which handles the decorator logic for single-output node cases in the Flowno framework: - @node() - @node(multiple_outputs=False) - @node(stream_in=[…])
This is an internal implementation detail used by the flowno.decorators.node
decorator, not meant to be used directly. See the node decorator documentation for
complete usage information and examples.
- class flowno.decorators.node_meta_single_dec.node_meta_single_dec(stream_in: list[str] = [])[source]
Handles the decorator logic for single-output node cases.
This class is returned by the @node() function when called with parameters, and implements __call__ to handle the actual function decoration. It creates appropriate DraftNode subclasses based on the decorated function or class and specified parameters.
- Parameters:
stream_in – List of parameter names that should be treated as streaming inputs
- Returns:
When called with a function or class, returns a DraftNode subclass factory for that function or class
- __call__(func_or_cls: Callable[[], Coroutine[object, object, _ReturnT_co]]) type[MonoNode0[tuple[_ReturnT_co]]] [source]
Apply the decorator to the given function or class.
This method is called when the decorator is applied to a function or class. It delegates to either create_class_node_subclass_single or create_func_node_factory_single depending on whether the decorated object is a class or function.
- Parameters:
func_or_cls – The function or class to transform into a node
- Returns:
A DraftNode subclass factory for the decorated function or class