-
Notifications
You must be signed in to change notification settings - Fork 268
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
to buffer output? #318
Comments
So, what do you mean, that a page can return data, and then at the end return .. like flush and yaws will then write everything back to the client? No, you know this is not supported. Shouldn't be too hard to emulate yourself though. |
Well, Yaws could keep a X bytes buffer and flush it when it is "filled". I've been experimenting with our streaming REST application and e.g a 4k buffer gives a significant improvement for large data sets returned. So I guess, being a bit lazy, I was hoping Yaws already had some support for it ;-) |
Have you tried using the Yaws streaming features, specifically the non-chunked delivery approaches described on that page? Seems like that feature would give you complete control over your app's buffering. |
Yes, I'm using it already. |
Adding some sort of optional buffering helper/utility for non-chunked streaming could be useful. I guess it would be a server process that would serve as the streaming pid, providing an API allowing callers to send data to it. It would take a buffer size as a start argument and would buffer an iolist of that size, flushing it as needed. Is this along the lines of what you were thinking? |
Ideally, it should not change the current API or adding something new. Just a config param 'StreamingBufferSize' which per default is Zero, i.e buffering is turned off, preserving the current behaviour. |
Just so I'm clear, you're suggesting that the |
No, I mean the yaws_api:stream_chunk_deliver/2 and friends... So, for example, when the user code, running in the Yaws process, returns control, it can do it Now, perhaps one could return something like: {streamcontent, MimeType, Data, BufferSize}, |
Indeed! He needs to get up to speed again... ;-) |
On 2018-02-02 10:12, Torbjörn Törnkvist wrote:
Indeed! He needs to get up to speed again... ;-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#318 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AADYIAqz5Ek1mnMiVDsvrwH0b00-JnSmks5tQtF5gaJpZM4RwXF5>.
Yeyy, I'll take it :-)
/klacke
|
Nice, @klacke ! I don't think it'll be too hard if we take the config variable route. The only hard part I can think of is how to test it? |
Let me fiddle with it for a while and we'll see.
/klacke
On 2018-02-06 21:01, Steve Vinoski wrote:
Nice, @klacke <https://github.com/klacke> !
I don't think it'll be too hard if we take the config variable route.
The only hard part I can think of is how to test it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#318 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AADYIFe9x7a2qDzAIg6mwRWAQbpRsAtsks5tSK-tgaJpZM4RwXF5>.
Lt
|
Just a little observation; I did a version where I used the stream_process* stuff to write directly on the socket. The result was a little bit slower than the "old" stream_content code. |
Does Yaws support buffering of the output?
I couldn't find it so I guess not...
Could perhaps be a nice little feature?
The text was updated successfully, but these errors were encountered: