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'm trying to create a service that will stream a multipart/x-mixed-replace of image/jpeg for a video streaming service.
Each image is roughly 22k and I'd like them to be sent to the I/O stream at the end of every image so the client can display them as it waits for the next.
The stream I've built retrieves the next image bytes via a channel receiver, adds the HTTP part headers and yields the resulting bytes.
The issue I'm getting is that the client is receiving 2 images at once, thus dropping the frame rate by 2 for the end user.
This seems to be because the Dispatcher will only send the buffer once the size has reached the MAX_BUFFER_SIZE and given buffer size is 32k, it takes 2 images to trigger the send (
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to create a service that will stream a multipart/x-mixed-replace of image/jpeg for a video streaming service.
Each image is roughly 22k and I'd like them to be sent to the I/O stream at the end of every image so the client can display them as it waits for the next.
The stream I've built retrieves the next image bytes via a channel receiver, adds the HTTP part headers and yields the resulting bytes.
The issue I'm getting is that the client is receiving 2 images at once, thus dropping the frame rate by 2 for the end user.
This seems to be because the Dispatcher will only send the buffer once the size has reached the MAX_BUFFER_SIZE and given buffer size is 32k, it takes 2 images to trigger the send (
actix-web/actix-http/src/h1/dispatcher.rs
Line 496 in fd81e6e
Is there an elegant way to force the write_buf to flush upon each yield.
Any help appreciated
Beta Was this translation helpful? Give feedback.
All reactions