spring-framework / org.springframework.web.reactive.function.server

Package org.springframework.web.reactive.function.server

Types

RouterFunctionDsl

open class RouterFunctionDsl

Provide a RouterFunction Kotlin DSL in order to be able to write idiomatic Kotlin code.

Functions

body

fun <T : Any> BodyBuilder.body(publisher: Publisher<T>): Mono<ServerResponse>

Extension for ServerResponse.BodyBuilder.body providing a body(Publisher<T>) variant. This extension is not subject to type erasure and retains actual generic type arguments.

bodyToFlux

fun <T : Any> ServerRequest.bodyToFlux(): Flux<T>

Extension for ServerRequest.bodyToFlux providing a bodyToFlux<Foo>() variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

bodyToMono

fun <T : Any> ServerRequest.bodyToMono(): Mono<T>

Extension for ServerRequest.bodyToMono providing a bodyToMono<Foo>() variant leveraging Kotlin reified type parameters. This extension is not subject to type erasure and retains actual generic type arguments.

bodyToServerSentEvents

fun <T : Any> BodyBuilder.bodyToServerSentEvents(publisher: Publisher<T>): Mono<ServerResponse>

Extension for ServerResponse.BodyBuilder.body providing a bodyToServerSentEvents(Publisher<T>) variant. This extension is not subject to type erasure and retains actual generic type arguments.

router

fun router(routes: RouterFunctionDsl.() -> Unit): RouterFunction<ServerResponse>

Allow to create easily a RouterFunction<ServerResponse> from a Kotlin router DSL based on the same building blocks than the Java one (RouterFunction, RequestPredicate, HandlerFunction).