Someone on Vert.x Gitter channel suggested replaci...
# ktor
d
Someone on Vert.x Gitter channel suggested replacing Netty's EventGroups w/ Vert.x's to implement a Vert.x bridge with Ktor, see: https://github.com/ktorio/ktor/blob/d1e3a495cfe26c32aa5af4b110f6af9ddbd329e4/ktor-server/ktor-server-netty/src/io/ktor/server/netty/NettyApplicationEngine.kt#L51 https://github.com/eclipse/vert.x/blob/master/src/main/java/io/vertx/core/http/impl/HttpServerImpl.java#L247 Then I could expose the Vert.x instance to the app somehow to use it to create Vert.x components like async dbs etc... is it possible that it's that easy, or are there possible pitfalls in this approach?
d
Nice. Not totally sure. But what’s the problem on having a few extra threads? (maybe I’m missing something)
d
Maybe nothing, I'm not familiar of all the internals, so I'm being careful, in the issue @orangy said "I think vert.x host for ktor is the way to go here. We will still need HTTP message processing and all the related stuff." and "I was thinking about hosting ktor app as a verticle, like a servlet in an app container"...?
d
If you want, I can try to do a prototype of an application engine using vertx and a small stress test and see what happens. It should be enough to see if there would be additional issues or it works fine.
o
I don’t know if they are compatible, or if it will have any unintended consequences. I’d really just make a vert.x engine, if you need interoperation there. It shouldn’t be that hard, I think.
d
There's tons of interfaces to implement, no? Would we have to make a new engine or just reuse part of Netty?
I don't know if Vert.x exposes everything, but as far as understood there's a few places that can just be casted to expose internals
d
Not that much interfaces: https://ktor.io/advanced/engines.html
jetty
o
if you initially target only http1.1, that should be relatively small
d
That's the difference w/ Jetty implementation? Why is it so much smaller?
So all the requests/responses would also be delegated to vert.x core handling them, and not the underlying Netty? @orangy
o
I don’t really know vert.x that good, sorry…
d
Np, I just wanted to clarify what has to be done...
o
I think @julienviet previously said he is ready to consult anyone who would implement ktor on top of vert.x
d
Right, but he doesn't know the Ktor side 🙂 ...
So, I'm just trying to figure out how to put things together...
o
I think you just need to start 🙂
d
True, I'll maybe give it a shot next week. It would help to know what's the minimum that needs to be implemented.. is Jetty the example to take from?
o
Minimum is engine, call, request & response, I think
👍🏼 1
k
Might want to look at the Spring vert.x integration...Spring is essentially hosting vert.x and it sounds like you're trying to use ktor to do the same thing?