You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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-PodeXXXResponsefunctions - most collapsing to Write-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 the route.
This is quite inconvenient in my case.
I would have preferred to be able to send the response data incrementally.
A hypothetical API:
# Do some input validation
...
# Start fetching data
...
# Send response headers (it's fine to do this in one block)
Write-PodeHeaders ...
while (...) {
# Once data available
Write-PodeBodyTextPart $firstPartOfData
...
}
...
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:
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.
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: