You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Python Node with no input always return None on .next() although we would want it to return STOP event so that we can gracefully stop it.
importpyarrowaspafromdoraimportNodenode=Node()
node.send_output("data", pa.array([1, 2, 3, 4, 5]))
event=node.next()
asserteventisnotNone, "we should expect a STOP event"assertevent["type"] =="STOP", "we should expect a STOP event"
That is expected with our current design. The event channel returns None as soon as all inputs of the node have been closed. This allows nodes to stop when they are no longer needed. The Stop event signals that the dataflow was stopped early as a consequence of a stop command. So it signals that the event channel might close sooner than usual.
We could of course special-case nodes with no inputs and keep their event channels open as long as the dataflow runs. However, such behavior differences would be inconsistent and surprising, and also difficult to document clearly. Another disadvantage is that next() is a blocking, so that a call without a timeout would block until the user cancels the dataflow.
How about we provide an additional dataflow_stopped function instead? This function could be non-blocking and return true as soon as the manual stop signal was received by the node. So it would be suitable for checking it a loop.
Describe the bug
Python Node with no input always return
None
on.next()
although we would want it to returnSTOP
event so that we can gracefully stop it.The text was updated successfully, but these errors were encountered: