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

Change fish-pepper to use promises #4

Open
rhuss opened this issue Sep 8, 2015 · 0 comments
Open

Change fish-pepper to use promises #4

rhuss opened this issue Sep 8, 2015 · 0 comments

Comments

@rhuss
Copy link
Contributor

rhuss commented Sep 8, 2015

We already have an async, promise based lib (nodegit, but see #3). Currently we need to use node-fibers for waiting on a promise fullfillment, which is a classical 'future'. However, since JavaScript is single threaded, this can not be easily done in plain JavaScript because the single thread will wait until a function returns (so you can't wait within a function on the result of an asnc operation, in fact even start the async operation won't even start). Therefore node fibers, an V8 extension, can be used to allow for multi-threading an hence waiting on promise from within a method.

But this comes with a cost: Installation of fibers takes its time, making everything more 'heavy weight'. Also, promises and callbacks are really more in the 'nature of JavaScript', so we shouldn't work against it (even not in a batch script like fish-pepper).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant