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.

Question: How to stream output?

See original GitHub issue

Hi,

I’d like to be able to stream content to the body of a request - imagine a long-running request body with a counter that outputs:

1
2
3
4

once per second, for up to N seconds.

I’ve spent 2-3 hours trying to figure out how to get a response stream and write to it, but it seems like some buffering and other weirdness is in the way. Any ideas on how to achieve this?

Thanks for making this nice and simple server otherwise.

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Kaliumhexacyanoferratcommented, Mar 24, 2023

So when the client disconnects and the server is no longer able to push data? Currently not, but an optional handler could be added for this case. My expectation would be, that there is no server error logged as this is a natural case which will always happen in this scenario - so a callback to handle this situation seems great.

1reaction
Kaliumhexacyanoferratcommented, Mar 22, 2023

Created #373 for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rust - How would you stream output from a Process?
Use Stdio::piped() to create a new pair of output streams; Configure command.stdout() , and command.stderr(); Spawn the process; Create a new ...
Read more >
Question / Help - OBS Output to TV while streaming
Right click the Program window and select full screen projector then select that monitor. Split that HDMI signal out of the computer to...
Read more >
Bloomberg | Output data from a stream in order
Write a program to output the data from the stream in realtime in order, so 1,2,3,4,5.. You cannot queue up the incoming data...
Read more >
How to use sed to manipulate continuously streaming ...
The issue seems to be that the command calls a second program, which then outputs to stdout. There are a few lines printed...
Read more >
Streaming data to an output text file - Elixir Forum
Hi, I am a newbie to Elixir so please forgive this basic question. I have written a stream function using Stream.unfold that produce...
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