https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

09/06/2019, 5:31 AM
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

yen

09/06/2019, 6:24 AM
I would chip in, but I have no experience with ktor
I really like http4k’s simple design
d

dave

09/06/2019, 8:36 AM
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

Xavier Hanin

09/06/2019, 9:22 AM
I’ve posted a comment - my first one on Reddit 🙂
👏 1
u

Uberto Barbini

09/06/2019, 9:26 AM
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

dave

09/06/2019, 10:53 AM
@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

Uberto Barbini

09/06/2019, 11:06 AM
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

dave

09/06/2019, 11:56 AM
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

Uberto Barbini

09/06/2019, 12:07 PM
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.
2 Views