Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every task iteration flows have not local scope #32

Open
behrad opened this issue Sep 29, 2013 · 0 comments
Open

Every task iteration flows have not local scope #32

behrad opened this issue Sep 29, 2013 · 0 comments

Comments

@behrad
Copy link
Contributor

behrad commented Sep 29, 2013

It seems every.item is not locally bound for each iteration of $every, I have an every task in which the sub-flow may pause or wait... (consider a long-time sub-task in each every iteration)

I was supposing for each iterations as standalone closures. but this is causing some bugs happening in my flow, so I consider this pattern harmful and race-prone to every sub-flows using internal variables!

[
    {
        "$function":"Array",
        "$args":[
            "data", "must", "flow"
        ],
        "$set":"data"

    },
    {
        "$every": "{$data}",
        "$tasks":[
            {
                "$class": "wait",
                "secs": 1,
                "$set": "ok_with_me"
            },
            {
                "if": "[*ok_with_me]",
                "$function": "console.print",
                "$args": ["Every item: ","[*every.item]"]
            }
        ]
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant