Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does main stream web server implement this feature?

Tags:

c

webserver

This means, for example, a module can start compressing the response from a backend server and stream it to the client before the module has received the entire response from the backend. Nice!

I know it's some kind of asynchronous IO but simple like that isn't enough.

Anyone knows?

like image 925
DriverBoy Avatar asked Jan 23 '26 14:01

DriverBoy


1 Answers

Without looking at the source code of an actual implementation, I'm speculating here:

It's most likely some kind of stream (abstract buffered IO) that is passed from one module to the other ("chaining"). One module (maybe a servlet container) writes to a stream that is read by another module (the compression module in your example), which then writes its output to another stream. The contents of that stream may then be processed further or transmitted to the client.

like image 52
Tony the Pony Avatar answered Jan 26 '26 07:01

Tony the Pony



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!