create

fun <T, D> create(function: KFunction<*>): MonoFunctionAccessor<T, Mono<D>>

Creates a MonoFunctionAccessor for the given function, automatically selecting the appropriate implementation based on the function's return type.

The factory chooses implementations as follows:

  • Mono return type: SimpleMonoFunctionAccessor

  • Flux return type: FluxMonoFunctionAccessor (collects to List)

  • Publisher return type: PublisherMonoFunctionAccessor

  • Synchronous return type: SyncMonoFunctionAccessor

If the function is annotated with @Blocking, it wraps the accessor with BlockingMonoFunctionAccessor.

Return

a MonoFunctionAccessor appropriate for the function's return type

Parameters

T

the type of the target object

D

the type of data in the Mono

function

the Kotlin function to create an accessor for