Once¶
Name | Mandatory | Description | Default | Type |
---|---|---|---|---|
⬅️ Input |
The input of the shard, if any | Any |
||
Output ➡️ |
The resulting output of the shard | Any |
||
Action |
No | The shard or sequence of shards to execute. | none |
Shard [Shard] |
Every |
No | The number of seconds to wait until repeating the action, if 0 the action will happen only once per wire flow execution. | none |
Float Var(Float) |
Executes the shard or sequence of shards with the desired frequency in a wire flow execution.
Details¶
If you run (Once)
with :Every
set to its default value (i.e., 0), the sequence of shards will be executed only once per wire flow execution. Since this a very common use case (initialize loop counters, etc.) there's an alias for this - (Setup)
.
Basically, (Setup)
is just (Once)
with its :Every
parameter value permanently set to 0.
Examples¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
[info] [test1] Hello World, every 1.5s during a wire flow execution
[info] [test1] Hello World, once during every wire flow execution
[info] [test2] counter set to 0 only once: 0
[info] [test2] counter incremented every time wire executes: 1
[info] [test2] counter incremented every time wire executes: 2
[info] [test2] counter incremented every time wire executes: 3
[info] [test2] counter incremented every time wire executes: 4
[info] [test2] counter incremented every time wire executes: 5