-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add ability to run sync tasks #26
Comments
Note that if we do this, sync tasks would need to throw errors instead of doing next(err). |
👍 Mocha style! |
Not sure if I agree with this one. Afraid this might create a tendency for people to make sync tasks. Not sure if the gain justifies the risk. Plus, the multiple syntax can become confusing for people trying to read the task. |
There is one good reason to not support thi. We have plans to support running parallel tasks in the future and, as @marcooliveira said, if people start making sync tasks then they won't benefit from it. |
Having this in mind, @mklabs and @sindresorhus can you give us your feedback? |
Most of my build tasks are synchronous, people will abuse the feature but that's a good thing, a flexible system should allow people to do bad things if they will. You can still run things like if they were in "parallel", if the task is synchronous they just won't benefit from the perf boost. |
Just wanted to add that if people want to make their tasks |
Less boilerplate == happy user :D |
I agree with @satazor on this. Even though it can make some users unhappy, it's a minor annoyance if it will make the community come up with richer tasks, that can leverage great features, like parallel tasks. |
I know @mklabs loves his async. I however don't, but I do see your argument about parallel tasks. I think extra speed for the task users is worth a tiny bit of extra hassle for the task authors. |
We could provide something similar to mocha. If the callback has a next, we assume it async, otherwise we call next under the hood.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/98463-add-ability-to-run-sync-tasks?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: