# http4k

Jordan Terrell

02/07/2020, 2:06 PM
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


02/07/2020, 3:12 PM
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.. 😞

Jordan Terrell

02/07/2020, 3:39 PM
Is there a writeup of the challenges somewhere I can read up on?


02/07/2020, 5:55 PM
@Jordan Terrell probably worth catching up with the discussion in this issue: that has most of the context and the challenges to add this support

James Richardson

02/07/2020, 7:18 PM
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?

Jordan Terrell

02/07/2020, 7:32 PM
At the moment, nothing. But it's a point against Http4k when proposing it's usage at some companies.


02/08/2020, 4:25 PM
What is the point against that these companies have?


02/09/2020, 10:54 PM
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

Jordan Terrell

02/10/2020, 3:36 PM
@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.


02/11/2020, 8:08 AM
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