(self, nodes: Iterable[Node], in_buffer_size: int = 1, out_buffer_size: int = 1, function_running_as: Literal['thread', 'process'] = 'thread')
| 345 | nodes: List[Node] |
| 346 | |
| 347 | def __init__(self, nodes: Iterable[Node], in_buffer_size: int = 1, out_buffer_size: int = 1, function_running_as: Literal['thread', 'process'] = 'thread'): |
| 348 | super().__init__(in_buffer_size, out_buffer_size) |
| 349 | self.nodes = [] |
| 350 | for node in nodes: |
| 351 | if isinstance(node, Node): |
| 352 | pass |
| 353 | elif isinstance(node, Callable): |
| 354 | if inspect.isgeneratorfunction(node): |
| 355 | node = ProviderFunction(node, function_running_as) |
| 356 | else: |
| 357 | node = WorkerFunction(node, function_running_as) |
| 358 | else: |
| 359 | raise ValueError(f"Invalid node type: {type(node)}") |
| 360 | self.nodes.append(node) |
| 361 | self.output_order = Queue() |
| 362 | self.lock = threading.Lock() |
| 363 | |
| 364 | def _in_thread_fn(self, node: Node): |
| 365 | try: |
nothing calls this directly
no test coverage detected