open class ReactiveAdapterRegistry
A registry of adapters to adapt a Reactive Streams Publisher to/from various async/reactive types such as CompletableFuture, RxJava Observable, and others.
By default, depending on classpath availability, adapters are registered for Reactor, RxJava 1, RxJava 2 types, CompletableFuture, and Java 9+ Flow.Publisher.
Author
Rossen Stoyanchev
Author
Sebastien Deleuze
Since
5.0
ReactiveAdapterRegistry()
Create a registry and auto-register default adapters. |
open fun getAdapter(reactiveType: Class<*>): ReactiveAdapter
Get the adapter for the given reactive type. open fun getAdapter(reactiveType: Class<*>, source: Any): ReactiveAdapter
Get the adapter for the given reactive type. Or if a "source" object is provided, its actual type is used instead. |
|
open static fun getSharedInstance(): ReactiveAdapterRegistry
Return a shared default NOTE: We highly recommend passing a long-lived, pre-configured |
|
open fun hasAdapters(): Boolean
Whether the registry has any adapters which would be the case if any of Reactor, RxJava 2, or RxJava 1 (+ RxJava Reactive Streams bridge) are present on the classpath. |
|
open fun registerReactiveType(descriptor: ReactiveTypeDescriptor, toAdapter: Function<Any, Publisher<*>>, fromAdapter: Function<Publisher<*>, Any>): Unit
Register a reactive type along with functions to adapt to and from a Reactive Streams Publisher. The functions can assume their input is never be |