diff --git a/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc b/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc index ff64c052e5..edca977e23 100644 --- a/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc +++ b/framework-docs/modules/ROOT/pages/languages/kotlin/coroutines.adoc @@ -14,6 +14,7 @@ Spring Framework provides support for Coroutines on the following scope: * Suspending function support in Spring MVC and WebFlux annotated `@Controller` * Extensions for WebFlux {spring-framework-api-kdoc}/spring-webflux/org.springframework.web.reactive.function.client/index.html[client] and {spring-framework-api-kdoc}/spring-webflux/org.springframework.web.reactive.function.server/index.html[server] functional API. * WebFlux.fn {spring-framework-api-kdoc}/spring-webflux/org.springframework.web.reactive.function.server/co-router.html[coRouter { }] DSL +* WebFlux {spring-framework-api-kdoc}/spring-web/org.springframework.web.server/-co-web-filter/index.html[`CoWebFilter`] * Suspending function and `Flow` support in RSocket `@MessageMapping` annotated methods * Extensions for {spring-framework-api-kdoc}/spring-messaging/org.springframework.messaging.rsocket/index.html[`RSocketRequester`] diff --git a/spring-web/src/main/java/org/springframework/web/server/WebFilter.java b/spring-web/src/main/java/org/springframework/web/server/WebFilter.java index 9a7ddeaf19..5180d6138f 100644 --- a/spring-web/src/main/java/org/springframework/web/server/WebFilter.java +++ b/spring-web/src/main/java/org/springframework/web/server/WebFilter.java @@ -23,6 +23,9 @@ import reactor.core.publisher.Mono; * be used to implement cross-cutting, application-agnostic requirements such * as security, timeouts, and others. * + *
Consider using {@code org.springframework.web.server.CoWebFilter} with + * Kotlin Coroutines. + * * @author Rossen Stoyanchev * @since 5.0 */ diff --git a/spring-web/src/main/kotlin/org/springframework/web/server/CoWebFilter.kt b/spring-web/src/main/kotlin/org/springframework/web/server/CoWebFilter.kt index a708e3c74a..4cf319dee6 100644 --- a/spring-web/src/main/kotlin/org/springframework/web/server/CoWebFilter.kt +++ b/spring-web/src/main/kotlin/org/springframework/web/server/CoWebFilter.kt @@ -26,7 +26,7 @@ import kotlin.coroutines.CoroutineContext /** * Kotlin-specific implementation of the [WebFilter] interface that allows for - * using coroutines. + * using coroutines, including [kotlin.coroutines.CoroutineContext] propagation. * * @author Arjen Poutsma * @author Sebastien Deleuze