If anyone wants to chip in with things you've foun...
# http4k
d
If anyone wants to chip in with things you've found good (or bad 🙃) when starting off then that would be great: https://www.reddit.com/r/Kotlin/comments/d06za9/ktor_vs_http4k/
y
I would chip in, but I have no experience with ktor
I really like http4k’s simple design
d
thanks! Although TBH, I think that the thread is going to end up with a load of people who haven't used both just saying what they like about the one they are using. 🙂
😂 1
x
I’ve posted a comment - my first one on Reddit 🙂
👏 1
u
I don't think is a fair comparison because they have completely different approach. Ktor should be compared with Vert.x or similar. Http4k with SparkJava. They may be interchangeable only for projects where the actual capabilities don't matter much, so it become just a matter of taste.
an interesant experiment would be to create a version of http4k using functional streams and kiesly arrows instead of simple Request->Response to perform functional async operations...
d
@Uberto Barbini well the http4k core is small enough to port easily to prove the concept - everything else is just window dressing. 🙂
👍 1
From our experiments with coroutines (on the spike branch), the main core ports very easily (only with HttpHandler becoming an interface - which we were considering doing and releasing as a standalone v4 release) - it's the server and client integrations which are a pain to do - especially the IO stuff.
u
Imho coroutines alone won't solve anything. They are just a nice syntax sugar over a cooperative multitasking loop. The important bit is how sockets are used.
If you are in the region of 10s request in parallel, it should make a sensible difference. Since we are rather using multiple ms instances for addressing loads, I don't have a use case for it.
d
TBH the main thing I'm looking at them for is when we could go full multiplatform - if coroutines can take care of bridging all the various runtime models then that would be a win. But we also have to look at the rest of the things binding us to the JVM - which is pretty much the Datetime and IO APIs
and I have a feeling that stability in those areas are some way off.. 😉
u
Trying to use coroutines as they were Threads is really creating a lots of problems in JVM. Basically it doesn't work but for the simplest of scenarios. So you need to understand coroutines (dispatcher and scope) and threads.