I know this is everyone's "favorite" question, but...
# http4k
j
I know this is everyone's "favorite" question, but are there any updates on async server support, either via coroutines or some other mechanism? Last mention of coroutines in this room (that I could find) was back in September, the GitHub issue was last updated in June, and the v4 Spike branch was last updated in October. Is anyone working on async server support or has that been put on hold?
👍 1
d
TBH, it's not being worked on at the moment - the main issues we face are to get the model plugged into the various servers and clients. Which definitely isn't simple.. 😞
j
Is there a writeup of the challenges somewhere I can read up on?
s
@Jordan Terrell probably worth catching up with the discussion in this issue: https://github.com/http4k/http4k/issues/94 that has most of the context and the challenges to add this support
j
I hope you don't mind me asking, but I'm really interested in your use case for async that the current model doesn't support. What is the limit that you have hit in your current deployment?
j
At the moment, nothing. But it's a point against Http4k when proposing it's usage at some companies.
n
What is the point against that these companies have?
a
I believe this is more a "general" question, when we discuss which web framework/library to use, one of the arguments is support for "async" model. Why async? Because it is regarded as more efficient, especially when it comes to threads usage in high load envs. I don't have exact data for comparison async vs sync because I never implemented exactly the same system two times: one in async and one in sync model
In some ecosystems async is a natural way, nobody's questioning that (e.g. scala), I can see that these concepts are slowly moving to Kotlin as well, especially after coroutines made production ready.
So any concrete answer from http4k team to question "what about async", even if that is only a plan, an example of a home-made-solution or a tutorial (how to implement async in lower layers of your app that plays nicely with http4k part), would help to wider adopt http4k
j
@natpryce Http4k is, to some degree, contending with ktor, micronaught, springboot, etc. These are not apples-to-apples comparisons by any means. However, when picking libraries/frameworks to handle HTTP requests, often a point-by-point comparison is done. Lack of good async/coroutine support comes up against Http4k from time to time. That was the only point I was making. Where I've used Http4k has mainly been CPU or memory bound, so it's been a good fit - but in an IO-bound scenario, async/coroutine support would likely be very beneficial.
n
Async is about trading off straight-line performance to reduce the total OS (and therefore hardware) resources required to serve all your concurrent clients. When your cloud provider is allocating resources for you per request that trade-off isn’t available.
So HTTP4K is a better fit for cloud functions than async frameworks. 😄
👍 1