ursus
06/24/2026, 8:10 PMktor vs kotlinx.rpc
The rpc library seems to give me a way to create server as well
and then in ktor there's is integration with this, but it also asks for port
So if I integrate the kotlinx.rpc into ktor, do I have 2 servers running? If so, does that make sense?Alexander Sysoev
06/24/2026, 9:11 PMursus
06/24/2026, 9:16 PMAlexander Sysoev
06/24/2026, 9:32 PMursus
06/24/2026, 9:32 PMAlexander Sysoev
06/24/2026, 9:33 PMursus
06/24/2026, 9:34 PMAlexander Sysoev
06/24/2026, 9:38 PMursus
06/24/2026, 9:42 PMAlexander Sysoev
06/25/2026, 4:55 AMsimon.vergauwen
06/25/2026, 7:43 AMursus
06/25/2026, 1:01 PMsimon.vergauwen
06/25/2026, 1:42 PMrunBlocking that hooks into OS signals (SIGTERM/SIGINT) and thus binds structured concurrency to the process. This allows you to just rely on coroutines and structured concurrency for cleanup so you can rely on any rxjava/project reactor, or future based SDK and integration them seamlessly into coroutines. Sometimes I have a small homegrown wrapper to wrap callback based systems into Channel/Flow but it depends on the SDKs and integrations you need.ursus
06/25/2026, 1:44 PMursus
06/25/2026, 1:52 PMsimon.vergauwen
06/25/2026, 1:52 PMursus
06/25/2026, 1:54 PMsimon.vergauwen
06/25/2026, 1:54 PMor maybe all the other thing i'd miss if I didnt wrap it in spring boot for example - auth, tracing, di, all the config stuffI rarely use Spring Boot, and re-using stuff or splitting stuff from Ktor is easier than with Spring. So often a common module for Ktor can be re-used without Ktor.
simon.vergauwen
06/25/2026, 1:55 PMdidnt you then reinvent ktor at that point?No, not at all. It's typically a common library pulled out of Ktor services.
ursus
06/25/2026, 1:56 PMsimon.vergauwen
06/25/2026, 1:56 PMursus
06/25/2026, 2:02 PMfun main() {
val server = GrpcServer(8080) {
services {
registerService<ImageRecognizer> { ImageRecognizerImpl() }
}
}
server.start()
server.awaitTermination()
}
to launch the thing i.e. to not wrap it with ktor or spring boot. It's nice that it's possible but --
my question is, should I do this? is it reasonable for production? Or should I always wrap it in ktor or spring boot or whateverAlexander Sysoev
06/25/2026, 2:05 PMursus
06/25/2026, 2:06 PMsimon.vergauwen
06/25/2026, 2:06 PMursus
06/25/2026, 2:07 PMIs it reasonable for production? Yes absolutely. Many other languages do this.but aren't you then missing all the logging tracing stuff?
simon.vergauwen
06/25/2026, 2:07 PMursus
06/25/2026, 2:08 PMfun main() {
val server = GrpcServer(8080) {
services {
registerService<ImageRecognizer> { ImageRecognizerImpl() }
}
}
server.start()
server.awaitTermination()
}
and call it a production ready service, can I? (I mean usually, in a professional company)simon.vergauwen
06/25/2026, 2:10 PMursus
06/25/2026, 2:11 PMAlexander Sysoev
06/25/2026, 2:11 PMursus
06/25/2026, 2:13 PMursus
06/25/2026, 2:15 PMAlexander Sysoev
06/25/2026, 2:18 PMursus
06/25/2026, 2:19 PMAlexander Sysoev
06/25/2026, 2:25 PMursus
06/25/2026, 2:27 PMAlexander Sysoev
06/25/2026, 2:33 PMAlexander Sysoev
06/25/2026, 2:35 PMwhat's why I'm trying to suss out your intuitionLet's not do this, please This is a support channel for Ktor-related topics, not CS learning I'm happy to help with questions and discuss topics, but not to act as a lecturer, there are other resources for that
ursus
06/25/2026, 2:53 PM