|
|
|
|
|
by WJW
1341 days ago
|
|
Pretty much every web application backend is like this? For efficiency it skips recreating the entire OS process, but serving a single web request is exactly preparing some parameters, the app thinking for a bit and then coming back with a response. Web app abstraction frameworks like Rack (Ruby), WAI (Haskell) and many others work exactly like that: they allow you to supply them with a function taking a HTTP request and returning a HTTP response, then run that for each incoming request. Nothing magical about that and it works extremely well in practice. |
|
So yeah, we can say web servers work like functions if we cut out all the bits that don't and call them separate applications. But realistically they're not.