public class Resume extends Object
RSocketConnector
or an RSocketServer
except for retry(Retry)
and token(Supplier)
which apply only to the client side.Constructor and Description |
---|
Resume() |
Modifier and Type | Method and Description |
---|---|
Resume |
cleanupStoreOnKeepAlive()
When this property is enabled, hints from
KEEPALIVE frames about how much data has been
received by the other side, is used to proactively clean frames from the store . |
Resume |
retry(Retry retry)
Configure the logic for reconnecting.
|
Resume |
sessionDuration(Duration sessionDuration)
The maximum time for a client to keep trying to reconnect.
|
Resume |
storeFactory(Function<? super ByteBuf,? extends ResumableFramesStore> storeFactory)
Configure a factory to create the storage for buffering (or persisting) a window of frames that
may need to be sent again to resume after a dropped connection.
|
Resume |
streamTimeout(Duration streamTimeout)
|
Resume |
token(Supplier<ByteBuf> supplier)
Customize the generation of the resume identification token used to resume.
|
public Resume sessionDuration(Duration sessionDuration)
By default this is set to 2 minutes.
sessionDuration
- the max duration for a sessionpublic Resume cleanupStoreOnKeepAlive()
KEEPALIVE
frames about how much data has been
received by the other side, is used to proactively clean frames from the store
.
By default this is set to false
in which case information from KEEPALIVE
is
ignored and old frames from the store are removed only when the store runs out of space.
public Resume storeFactory(Function<? super ByteBuf,? extends ResumableFramesStore> storeFactory)
By default InMemoryResumableFramesStore
is used with its cache size set to 100,000
bytes. When the cache fills up, the oldest frames are gradually removed to create space for new
ones.
storeFactory
- the factory to use to create the storepublic Resume streamTimeout(Duration streamTimeout)
timeout
value to apply to the resumed
session stream obtained from the store
after a reconnect. The
resume stream must not take longer than the specified time to emit each frame.
By default this is set to 10 seconds.
streamTimeout
- the timeout value for resuming a session streampublic Resume retry(Retry retry)
RSocketConnector.resume(Resume)
on the client side only.
By default this is set to:
Retry.backoff(Long.MAX_VALUE, Duration.ofSeconds(1))
.maxBackoff(Duration.ofSeconds(16))
.jitter(1.0)
retry
- the Retry
spec to use when attempting to reconnectpublic Resume token(Supplier<ByteBuf> supplier)
RSocketConnector.resume(Resume)
on the client side only.
By default this is ResumeFrameFlyweight::generateResumeToken
.
supplier
- a custom generator for a resume identification token