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.

stream: function() support doesn't work as documented.

See original GitHub issue

The docs say that the function is async and should call a callback upon creation of the stream.

  stream: function (cb) {
    const newStream = new SocksConnection({host: 'remote.host', port: 3306}, {host: 'localhost', port: 1080});
    cb(null, newStream);
  }

The code says the function is synchronous and should return the stream.

      // if stream is a function, treat it as "stream agent / factory"
      if (typeof opts.config.stream == 'function') {
        this.stream = opts.config.stream(opts);
      } else {

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sidorarescommented, Feb 12, 2020

So you mean creating a duplex, returning that, and then connecting the new stream once its created asynchronously?

yes, something like that. I’m also happy to try to add support for Promise<Stream> result

1reaction
sidorarescommented, Feb 12, 2020

you can still do it lazily - return first “half” of the stream synchronously and connect events later when you have downstream connection, though it’s not the best experience

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial - Run Azure Functions in Azure Stream Analytics jobs
In this tutorial, you learn how to configure Azure Functions as an output sink to Stream Analytics jobs.
Read more >
Asynchronous programming: Streams | Dart
What's the point? Streams provide an asynchronous sequence of data. Data sequences include user-generated events and data read from files.
Read more >
Stream | Node.js v19.3.0 Documentation
A stream is an abstract interface for working with streaming data in Node.js. ... If the consumer of the Stream does not call...
Read more >
Analyze Java Stream operations | IntelliJ IDEA Documentation
Suspend the program at a line where the stream is used. You can use any stream operation for this including terminal ones.
Read more >
Stream (Java Platform SE 8 ) - Oracle Help Center
Streams have a BaseStream.close() method and implement AutoCloseable , but nearly all stream instances do not actually need to be closed after use....
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