-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Send back response data while still processing #1466
Comments
Thanks for the tip. I note at first glance:
Did you mean to say SSE would be a drop-in, or rather that the use-case can be adapted to use SSE? |
I responded a bit hastily. SSE is a web browser feature. If you need to feed a webpage with data, this is the most technically sound solution to use. However, if your request is not coming from a web page, other methods like a multipart stream can be employed. |
Hmm ... isn't |
Hi @bilbothebaggins, SSE would be the best case, but it depends on how where you're going to call the Route, and how you're going to handle the data as it's streamed back from the server:
|
It's a mixed bag ... it's an API call to populate a dynamic dropdown on a Jenkins CI Job Parameter. Anyways ... since this was even slower than I anticipated, I had to implement some caching anyway. I might as well outline this for future readers:
A bit involved, but it worked fine for this endpoint. |
I wanted to implement a very simple HTTP server to query some large/slow datasets in our buildsystem.
This means that generating the data for a GET request can take many seconds.
I noticed that the programming model with all
Write-PodeXXXResponse
functions - most collapsing toWrite-PodeTextResponse
as far as I can tell - is to collect all the data and then send back the headers and body in one go at the end of theroute
.This is quite inconvenient in my case.
I would have preferred to be able to send the response data incrementally.
A hypothetical API:
I know I could start fiddling with
Response.Send()
or the underlying request, but it seems this would be very flaky.Am I maybe missing something?
The text was updated successfully, but these errors were encountered: