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

Add callback argument to applyPatches patched option #130

Merged
merged 2 commits into from
Aug 23, 2016

Conversation

piranna
Copy link
Contributor

@piranna piranna commented Aug 18, 2016

This fixes #129

@piranna
Copy link
Contributor Author

piranna commented Aug 18, 2016

This one looks good !

Thanks! ^^

@kpdecker
Copy link
Owner

It's generally bad form to combine multiple features into one pull request. Please back out #131 from this as I don't want that in here.

WRT this exact feature, I'm worried about making this a breaking change. I'm not sure if it would be better to do something like patchedAsync or similar. Can you walk me through the use case that requires the patched callback to be async?

@piranna
Copy link
Contributor Author

piranna commented Aug 21, 2016

It's generally bad form to combine multiple features into one pull request. Please back out #131 from this as I don't want that in here.

I added it here since they were somewhat related. I can be able to remove it #131 is not open for discussion.

WRT this exact feature, I'm worried about making this a breaking change. I'm not sure if it would be better to do something like patchedAsync or similar.

Another option would be to check the number of arguments of the function to see if it has defined a callback (options.patched.length === 3) and if so use it async, and otherwise sync.

Can you walk me through the use case that requires the patched callback to be async?

On download-manager I'm using it to apply patches to Linux kernel, GCC and some other tools for NodeOS and write them back to the filesystem before start processing or compiling them, so I need both to be sure they have been fully written before using them and to capture any possible error when writting to manage it cleanly. I could be able to write them synchronously to the filesystem and using a try-catch, but all the module is fully async and this would be like an alien, and also it would became a bottleneck and decrease performance (I'm downloading, decompressing, patching and writting the files on the fly...).

@kpdecker
Copy link
Owner

Ok, I think that makes sense re: async w/ async. I don't want to go the route of checking the args length because that can also have unexpected conseqences, but I'm fine merging this and making it a major release after the changes for #131 are removed.

@piranna
Copy link
Contributor Author

piranna commented Aug 21, 2016

I don't want to go the route of checking the args length because that can also have unexpected conseqences

I agree, it's good to know that kind of magic but it's not necesary to use it often...

but I'm fine merging this and making it a major release after the changes for #131 are removed

Changes for issue #131 reverded.

@kpdecker
Copy link
Owner

Looks like even with the revert, there is still coverage missing. Could you make the tests green?

@piranna
Copy link
Contributor Author

piranna commented Aug 21, 2016

Looks like even with the revert, there is still coverage missing. Could you make the tests green?

Done, I wanted to check validity of the pull-request before.

@piranna
Copy link
Contributor Author

piranna commented Aug 21, 2016

Now tests coverage is passing on CI server

@kpdecker kpdecker merged commit fbc020e into kpdecker:master Aug 23, 2016
@kpdecker
Copy link
Owner

Released in 3.0.0

@piranna
Copy link
Contributor Author

piranna commented Aug 23, 2016

Thank you :-)

El 23/8/2016 14:17, "Kevin Decker" [email protected] escribió:

Released in 3.0.0


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#130 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAgfvlWbwEr-iiLEYpF8zWD85R9ty7aCks5qiuTkgaJpZM4Jn7pF
.

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

Successfully merging this pull request may close these issues.

Make applyPatches patched callback async
3 participants