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

Can A Rule Be An Async Function? #393

Open
virtualpatterns opened this issue Apr 15, 2021 · 0 comments
Open

Can A Rule Be An Async Function? #393

virtualpatterns opened this issue Apr 15, 2021 · 0 comments

Comments

@virtualpatterns
Copy link

I've tried the following as a test ...

Rule('b', 'source/index.js', function () {
  console.log(`Waiting on '${this.name}' ...`)
  return new Promise((resolve) => {
    setTimeout(resolve, 5000)
  })
})

Task('a', [ 'b' ], function () {
  console.log(`Waiting on '${this.name}' ...`)
  return new Promise((resolve) => {
    setTimeout(resolve, 5000)
  })
})

... but the Rule is never waited upon. The Rule should take at least 5s to run but it takes < 1ms ... it is never completed.

Sync Rule functions behave as expected but not async functions. Should they?

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