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

Request module #20

Open
tenoriojuann opened this issue Feb 20, 2020 · 2 comments
Open

Request module #20

tenoriojuann opened this issue Feb 20, 2020 · 2 comments

Comments

@tenoriojuann
Copy link
Contributor

The Request module has been deprecated.

@uzquiano
Copy link
Member

I was just reading about it:
request/request#3142

Have you tried any other replacement node modules?

The bent module looks interesting - fully betting on async as a primary pattern:
https://github.com/mikeal/bent

I'm not sure the deprecation of request will impact the JS driver much here. It uses XHR libs under the hood. However, the newer driver we've been working on had a request engine that we'll now have to refactor. It would be nice to find something with some longevity.

Personally, I'm not all that enamored with async. Callbacks, for all of their verbose expression, are still one of JavaScript's strengths. I fear the async pattern could lead to a lot of poorly written code that stalls waiting for the event loop. Promises make sense but promises + serial execution + network latency leads to slow, slow code.

@tenoriojuann
Copy link
Contributor Author

We are currently looking at different options (fetch-nodejs, axios).

The only reason I openen an issue here was because we currently use the method Gitana.streamDownload which uses the request module. Which on a side note we sometimes see issues downloading images, I modified the options passed to the request object to include encoding: null and that makes it work.

Yes, the async pattern for web related stuff has its drawbacks but if used correctly it can make code easier to understand since we will not have the famous callback hell

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

2 participants