Comments (6)
What went wrong with the first attempt?
from teeny-request.
@stephenplusplus we always piped the response body into the user stream, but I think we want to do it conditionally based on whether or not the user is actually trying to read from it.
from teeny-request.
It seems fair to assume if the user wants stream mode (signaled by not providing a callback), they want to read from it. Am I not considering something?
from teeny-request.
I think in its current state, it is not possible to read from yet we use it as a stream in places successfully. To me this implies that if we pipe unnecessarily we might be creating a (slow) memory leak?
from teeny-request.
AFAIK, our libs use teeny-request through retry-request (configured in common). retry-request gets the stream from the response event: https://github.com/stephenplusplus/retry-request/blob/6f69c95dceada6b4255c148fbd27c4d530fcec3e/index.js#L146.
But, I see the issue you're pointing out now. In the request
library, they always piped a decorated stream back, but emitted the raw http.IncomingMessage response stream if the user needed it. So technically to be compatible as a straight conversion from request, we'd need to follow the same pattern, but I think we've come to care less about being 1:1 with request.
In any case, I think I have a solution in mind. I'll PR it up.
from teeny-request.
PR sent over here: #74
from teeny-request.
Related Issues (20)
- Warning: a recent release failed HOT 1
- Warning: a recent release failed HOT 1
- Synthesis failed for teeny-request HOT 1
- Synthesis failed for teeny-request HOT 3
- wish: add request-promises compatibility HOT 9
- maxSockets is not passed to the underlying agent when forever:true
- Warning: a recent release failed
- multipart with 2 or more parts never resolves, possible incorrect multiplexing HOT 4
- Synthesis failed for teeny-request HOT 4
- Broken badge link and svg
- Dependency Dashboard
- CVE-2020-15168 node-fetch
- Synthesis failed for teeny-request HOT 3
- Synthesis failed for teeny-request HOT 1
- PR to fix undefined error in getAgent? HOT 2
- teeny: should include the request in the response failed HOT 1
- npm i teeny-request HOT 1
- Cannot bundle this lib HOT 5
- Your .repo-metadata.json file has a problem 🤒
- Warning: a recent release failed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teeny-request.