public static interface RSocketStrategies.Builder
RSocketStrategies
.Modifier and Type | Method and Description |
---|---|
RSocketStrategies |
build()
Builder the
RSocketStrategies instance. |
RSocketStrategies.Builder |
dataBufferFactory(DataBufferFactory bufferFactory)
Configure the DataBufferFactory to use for allocating buffers, for
example when preparing requests or when responding.
|
RSocketStrategies.Builder |
decoder(Decoder<?>... decoder)
Add decoders for de-serializing Objects.
|
RSocketStrategies.Builder |
decoders(java.util.function.Consumer<java.util.List<Decoder<?>>> consumer)
Access and manipulate the list of configured
decoders . |
RSocketStrategies.Builder |
encoder(Encoder<?>... encoder)
Add encoders to use for serializing Objects.
|
RSocketStrategies.Builder |
encoders(java.util.function.Consumer<java.util.List<Encoder<?>>> consumer)
Access and manipulate the list of configured
encoders . |
RSocketStrategies.Builder |
reactiveAdapterStrategy(ReactiveAdapterRegistry registry)
Configure the registry for reactive type support.
|
RSocketStrategies.Builder encoder(Encoder<?>... encoder)
By default this is empty.
RSocketStrategies.Builder decoder(Decoder<?>... decoder)
By default this is empty.
RSocketStrategies.Builder encoders(java.util.function.Consumer<java.util.List<Encoder<?>>> consumer)
encoders
.RSocketStrategies.Builder decoders(java.util.function.Consumer<java.util.List<Decoder<?>>> consumer)
decoders
.RSocketStrategies.Builder reactiveAdapterStrategy(ReactiveAdapterRegistry registry)
Publisher
.
By default this ReactiveAdapterRegistry.sharedInstance
.
registry
- the registry to useRSocketStrategies.Builder dataBufferFactory(DataBufferFactory bufferFactory)
io.rsocket.RSocketFactory
.
By default this property is an instance of
DefaultDataBufferFactory
matching to the default frame decoder in
io.rsocket.RSocketFactory
which copies the payload. This
comes at cost to performance but does not require reference counting
and eliminates possibility for memory leaks.
To switch to a zero-copy strategy,
configure RSocket
accordingly, and then configure this property with an instance of
NettyDataBufferFactory
with a pooled allocator such as
PooledByteBufAllocator#DEFAULT
.
bufferFactory
- the DataBufferFactory to useRSocketStrategies build()
RSocketStrategies
instance.