Hello sorry for noob question. I notice this post ...
# http4k
d
Hello sorry for noob question. I notice this post at FaQ,
Copy code
Q. Does http4k support an Async model? I need webscale!

A. Not at the moment. Adding Async support is a decision that we are thinking about carefully so that we don't end up complicating the API. When we do add it, it'll probably use co-routines and they're still marked as experimental which is another reason we are holding off. As for the scaling arguments, see the above answer relating to production usage.
But I'm seeing this library also support
Copy code
- Apache sync + async HTTP
- Jetty HTTP (supports sync and async HTTP)
- OkHttp HTTP (supports sync and async HTTP)
- Java (bundled with http4k-core)
Which mean support async model, isnt it ?
n
I’m assuming HTTP4K doesn’t support async servers, i.e. handling requests asynchronously; it can only use pre-existing async HTTP clients.
✔️ 2
d
@Nezteb is 💯% correct here. The asynchronous http client support is built into the clients in case you needed it. As above, these clients are not coroutine-based. We have a migration path spiked and planned for the switch to coroutines, but at the moment it's not imminent. One of the main API niggles is that you can't extend from a suspend function in Kotlin, which means that HttpHandler would have to become an interface, in the same style as Filter. We also need to do the work to plug the coroutines into the various server backends and clients.
d
Thanks for the explanation, really appreciated ~
d
np 🙂
n
In the world of microservices though, this is less of an issue. The HTTP4K service I’ve been building runs with 3 instances inside kubernetes and if the thread pools become overtaxed more instances are temporarily spun up to deal with the load.
(still an issue, but less so 😄)
d
WRT performance, a previous client with a top ~700 global site (according to alexa.com) which runs pretty much all on http4k runs all their traffic on between 4-6 CloudFoundry instances of various microservices. No tuning required apart from the standard GC-options. They do a few 10's of millions of hits a day last time I saw it measured.
d
That's pretty cool ~