question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC - Provide true node streams

See original GitHub issue

After investigating the pause / resume functionality for our existing Request objects, I looked into what it would take to turn them into bonafide streams instead of a semi-ducktyped stream.

Current issues

At the moment the Request class is quite complicated and has sprinklings of if (this.stream) throughout and I feel we could greatly simplify the core logic by moving to a “stream first” implementation where Requests could be promisified on demand.

The Requests from tedious are essentially streams, so this would allow us to interface with them in a more straightforward fashion.

The current stream implementation we have doesn’t work particularly well if you also want to make use of the promise functionality, so we need to clear up that usage a bit more too.

Changes required

  • Request object extends stream.Readable
  • Stream operates in object mode
  • Add promise transformation method to Request

Impact

  • Deprecation of row event and replaced with data event (generally conform to the Stream interface)
  • Requests will not be promises by default

Challenges

  • Error handling
  • msnodesqlv8 doesn’t support resume/pause of requests

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jansivanscommented, Sep 6, 2019

Can you please add information to the docs that this is not a real stream and it is just some custom “request”? Because I thought it is the usual nodejs stream (it actually has the same methods like pause, resume and some events) and have wasted few days debugging my app.

0reactions
dhensbycommented, Nov 19, 2020

this was fixed in #1078

Read more comments on GitHub >

github_iconTop Results From Across the Web

Operational Considerations for Streaming Media RFC 9317
This document uses these terms to describe the streaming media ecosystem: Streaming Media Operator: an entity that provides streaming media servers Media ...
Read more >
RFC 4960: Stream Control Transmission Protocol
1. Handle Stream Parameters In the INIT and INIT ACK chunks, the sender of the chunk MUST indicate the number of outbound streams...
Read more >
TLS (SSL) | Node.js v19.3.0 Documentation
The node:tls module provides an implementation of the Transport Layer ... it is of critical importance to use sufficient entropy as discussed in...
Read more >
Call SAP RFC Function Modules from AWS Lambda using the ...
SAP provides the NW RFC SDK as C++-libraries. For Node.js (or other runtime environments) to use it, those libraries need to first be...
Read more >
YAML Ain't Markup Language (YAML™) revision 1.2.2
Typically, most tags are not explicitly specified in the character stream. During parsing, nodes lacking an explicit tag are given a non- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found