Ktor 3.0 launches with Kotlin 2.0, enhanced IO, and real-time features
Oct 11, 2024 at 5:05 PM

Ktor 3.0 launches with Kotlin 2.0, enhanced IO, and real-time features

Ktor 3.0 has been released, bringing major updates such as the integration of Kotlin 2.0 and the adoption of the kotlinx-io library. This new library enhances performance and unifies IO functionality with a multiplatform API capable of handling various data sources, including files and compression. The update deprecates older IO APIs like Input, Output, ByteReadChannel, and ByteWriteChannel, although these will remain supported until version 4.0.

Significant performance improvements, with over 90% enhancements in certain scenarios, are achieved by reducing byte copying between channels and network interfaces. Additionally, the update introduces initial support for Server-Sent Events (SSE), which enhances real-time communication by allowing servers to push event updates to clients over HTTP.

Beyond performance enhancements, Ktor 3.0 offers new features such as the StaticZip function for serving ZIP archive contents as static content and a CSRF protection plugin to safeguard state-changing operations like POST, PUT, and DELETE. The Ktor client now supports WebAssembly as a build target, further expanding the Kotlin Multiplatform ecosystem. Changes to the TestApplication class necessitate explicit module loading, while plugin updates include a renamed CallLogging plugin package and the replacement of the Locations plugin with the new Resources plugin for type-safe routing.

Oct 11, 2024 by Mauricio B. Holguin

MORE ABOUT: #Kotlin#Ktor
Ktor iconKtor
  1
  • FreeOpen Source
  • ...

Ktor is a framework designed for constructing asynchronous servers and clients within connected systems utilizing Kotlin. It comprises a server engine and a versatile asynchronous HTTP client, allowing developers to create scalable and efficient network applications. Ktor's architecture supports both server-side and client-side development, offering flexibility for a wide range of use cases.

No comments so far, maybe you want to be first?
Gu