Once¶
Name | - | Description | Default | Type |
---|---|---|---|---|
<input> |
Any |
|||
<output> |
Any |
|||
Action |
The shard or sequence of shards to execute. | None |
Shard [Shard] |
|
Every |
The number of seconds to wait until repeating the action, if 0 the action will happen only once per wire flow execution. | None |
Float &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 |
|
[info] [test] Hello World, every 1.5s during a wire flow execution
[info] [test] Hello World, once during every wire flow execution
[info] [test] Hello World, every 1.5s during a wire flow execution
[info] [test] Hello World, every 1.5s during a wire flow execution
[info] [test] Hello World, every 1.5s during a wire flow execution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
[info] [test] counter set to 0 only once: 0
[info] [test] counter incremented every time wire executes: 1
[info] [test] counter incremented every time wire executes: 2
[info] [test] counter incremented every time wire executes: 3
[info] [test] counter incremented every time wire executes: 4
[info] [test] counter incremented every time wire executes: 5