Published On Jul 24, 2024
Recording brought to you by American Express. https://americanexpress.io/kotlin-jobs
Many teams use Ktor solely to create and consume RESTful services over HTTP. They build modestly sized microservices and clients that perform a limited set of tasks well. Whilst these are completely valid use cases, they only scratch the surface of what is possible with Ktor.
Ktor includes support for Server Sent Events, WebSockets and kotlinx-io. These technologies allow you to incrementally stream data from client to server, such as when reading tokens from an LLM. You can also implement bidirectional conversations, recover from errors, and implement your own buffering strategies. At a higher level, in the design of your applications, you can use Dependency Injection frameworks like Koin, Kodein and Hilt to create and inject the correct networking client, repository, cache etc… for the current environment.
This talk will demonstrate how to configure Ktor Server and Client for a range of non-trivial tasks. You will see how to make best use of both existing, external libraries and upcoming enhancements to the framework itself.