flow icon indicating copy to clipboard operation
flow copied to clipboard

Initializers should be applied gradually

Open andrewdavidmackenzie opened this issue 1 year ago • 1 comments

When an array is an initializer, currently the entire array is serialized and sent when the initializer is applied.

However, only one element should be sent, and the next one the next time it goes idle etc.

Thus, this example:

flow = "print-sequence"
docs = "DESCRIPTION.md"

[[process]]
alias = "sequence-of-sequences"
source = "lib://flowstdlib/math/sequence"
input.start = { always =  0 }
input.step = { always = 1 }
input.limit = { once = [1, 2, 3] }

[[connection]]
from = "sequence-of-sequences/sequence"
to = "stdout"

# Print the sequence-of-sequences to stdout
[[process]]
source = "context://stdio/stdout"

produces

0
1
2
0
1
2
0
1
2
3

instead of

0
1
0
1
2
0
1
2
3

andrewdavidmackenzie avatar Sep 18 '22 09:09 andrewdavidmackenzie