GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Promisify async wrapper by sam-github · Pull Request #688 · nodejs/node

Conversation

@sam-github

@sam-github sam-github commented Feb 2, 2015

Copy link
Copy Markdown
Contributor

Alternate approach to promisification done by @bajtos in #173

I added more direct support for promise-like fulfill/reject in req_wrap, in the hopes it would be faster if support went deeper into C++.

The benchmarks are noisy on the machines I have access to, but it AFAICT, performance is no better or worse than node, for callback case. Also, no better or worse than #173 for the Promise case.
.
There are some open questions about whether direct use of a v8::Promise:Resolver object could be faster, but I'm blocked on that because I can't create one with any slots, so Wrap() can't work on it.

I'm also interested to look at bluebird, which at least one commentator claimed was faster than #173 when it promisifies fs. If so, it should be possible to improve the promise path in pure js.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
sam-github added 2 commits January 9, 2015 12:44
@sam-github
fs: C++ promisification of fs.stat
230cf27
@sam-github
!benchmarks from io.js#173
a6313a6
@sam-github sam-github mentioned this pull request Feb 2, 2015
Feature Request: Every async function returns Promise #11
Closed
@vkurchatkin

vkurchatkin commented Feb 2, 2015

Copy link
Copy Markdown
Contributor

whether direct use of a v8::Promise:Resolver object could be faster

I seriously doubt that, because it simple calls some high level js functions.

I don't like the approach where both callbacks and promises could be used. I think there should be separate set of functions that return promises.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Feb 2, 2015

Copy link
Copy Markdown
Contributor

I don't like the approach where both callbacks and promises could be used. I think there should be separate set of functions that return promises.

I would prefer it over this situation: fs.thingSync() fs.thing() fs.thingPromise()

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented Feb 2, 2015

Copy link
Copy Markdown
Contributor

Given that promises exemplify the future of async in ES6/7 javascript, we should be looking to the future as having those default returns on async functions IMO. (where it makes sense)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123 Fishrock123 added the ideas label Feb 3, 2015
brendanashworth
brendanashworth reviewed Feb 13, 2015
View reviewed changes
Comment thread lib/fs.js Outdated

@brendanashworth brendanashworth Feb 13, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe switch to typeof callback === 'function'?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chrisdickinson chrisdickinson added the land-on-master label Apr 17, 2015
@Fishrock123 Fishrock123 added future discuss Issues opened for discussion and feedback. and removed ideas labels Apr 28, 2015
@Fishrock123

Fishrock123 commented Jun 15, 2015

Copy link
Copy Markdown
Contributor

This is interesting, but I'm going to close it out for further discussion on NG as per #11 (comment), and that there isn't momentum at this time. This is a great reference for future discussions though, thanks for making it!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123 Fishrock123 closed this Jun 15, 2015
@Fishrock123 Fishrock123 mentioned this pull request Aug 13, 2015
Feature request: fs async methods to return promises if callback is not provided. #2368
Closed
@sam-github
sam-github deleted the promisify-async-wrapper branch April 17, 2017 20:40
@jefeaguila jefeaguila mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities jefeaguila/node#37
Open
@buzzlightyear726 buzzlightyear726 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities buzzlightyear726/node#39
Open
@jefeaguila jefeaguila mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities jefeaguila/node#41
Open
@buzzlightyear726 buzzlightyear726 mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities buzzlightyear726/node#44
Open
@Renukaloch Renukaloch mentioned this pull request Feb 11, 2024
[Snyk] Fix for 1 vulnerabilities Renukaloch/node#26
Open
@buzzlightyear726 buzzlightyear726 mentioned this pull request Feb 12, 2024
[Snyk] Fix for 1 vulnerabilities buzzlightyear726/node#51
Open
@ikreymer ikreymer mentioned this pull request Sep 17, 2024
Brotli decompression error webrecorder/browsertrix-crawler#687
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

discuss Issues opened for discussion and feedback.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sam-github @vkurchatkin @Fishrock123 @brendanashworth @chrisdickinson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.