fluksio.arrived(): a node can tell which inputs the wave behind it wrote, so a value written again unchanged is seen
This commit is contained in:
@@ -92,6 +92,27 @@ Pass this callback to your training framework. It publishes through the same
|
||||
declared ports as `yield`. Outside a node, `emit` does nothing, so ordinary
|
||||
tests can still call your code.
|
||||
|
||||
### `fluksio.arrived`
|
||||
|
||||
Every input arrives as an argument, whether it was just written or only
|
||||
sits in state from before. `arrived()` names the input ports that the message
|
||||
which started this run wrote:
|
||||
|
||||
```python
|
||||
import fluksio
|
||||
|
||||
|
||||
def process(auto, manual):
|
||||
if "manual" in (fluksio.arrived() or ()):
|
||||
return {"command": manual}
|
||||
return {"command": auto}
|
||||
```
|
||||
|
||||
A value written again unchanged counts as arrived. That is how a node tells
|
||||
somebody repeating a command apart from a value that has not moved. When the
|
||||
engine cannot say, such as when a flow starts, when a paused flow resumes, or
|
||||
outside a node, it returns `None`.
|
||||
|
||||
## Bytes: artifacts
|
||||
|
||||
Save files or bytes with `save_artifact`, then return the reference through an
|
||||
|
||||
Reference in New Issue
Block a user