return¶
Special Return sink that tube runners use to return values from TubeRunner.process()
- pydantic model Return[source]¶
Special sink node that returns values from a tube runner’s process method
- Config:
extra: str = forbid
- Fields:
- field stateful: bool = False¶
Whether this node is stateful (True), or stateless (False). Stateful nodes are assumed to care about the order in which they receive events - i.e. for a given set of inputs, the values returned by
processare different when called in a different order.This attribute has no effect in synchronous runners, but in concurrent runners where multiple epochs of events can be processed simultaneously, setting a node as stateless can improve performance as the node processes events as soon as it receives them rather than waiting for the next epoch in the sequence to arrive.
Defined as an instance, rather than a class attribute to allow it being overridden by a node specification. Subclasses should override the default value to be considered stateless by default.
By default, unless specified otherwise:
Class nodes are considered stateful
Generator nodes are considered stateful
Function nodes are considered stateless
- model_post_init(_Node__context: Any) None¶
See docstring of
process()for description of post init wrapping of generators
- process(*args: Any, _Return__events: dict[Annotated[str, AfterValidator(func=_is_identifier), AfterValidator(func=_not_reserved)], Event], **kwargs: Any) MetaSignal[source]¶
Store the incoming value to retrieve later with
get()