public class ResumableDuplexConnection extends Object implements DuplexConnection, ResumeStateHolder
Disposable.Composite, Disposable.Swap| Constructor and Description |
|---|
ResumableDuplexConnection(String tag,
DuplexConnection duplexConnection,
ResumableFramesStore resumableFramesStore,
Duration resumeStreamTimeout,
boolean cleanupOnKeepAlive) |
| Modifier and Type | Method and Description |
|---|---|
double |
availability() |
void |
disconnect() |
void |
dispose() |
long |
impliedPosition() |
boolean |
isDisposed() |
Mono<Void> |
onClose()
Returns a
Publisher that completes when this RSocket is closed. |
void |
onDisconnect(Runnable onDisconnectAction) |
void |
onImpliedPosition(long remoteImpliedPos) |
void |
onResume(Runnable onResumeAction) |
long |
position() |
Flux<ByteBuf> |
receive()
Returns a stream of all
Frames received on this connection. |
void |
reconnect(DuplexConnection connection) |
void |
resume(long remotePos,
long remoteImpliedPos,
Function<Mono<Long>,Mono<Void>> resumeFrameSent) |
Mono<Void> |
send(org.reactivestreams.Publisher<ByteBuf> frames)
Sends the source of Frames on this connection and returns the
Publisher representing
the result of this send. |
Mono<Void> |
sendOne(ByteBuf frame)
Sends a single
Frame on this connection and returns the Publisher representing
the result of this send. |
public ResumableDuplexConnection(String tag, DuplexConnection duplexConnection, ResumableFramesStore resumableFramesStore, Duration resumeStreamTimeout, boolean cleanupOnKeepAlive)
public void disconnect()
public void onDisconnect(Runnable onDisconnectAction)
public void onResume(Runnable onResumeAction)
public void reconnect(DuplexConnection connection)
public void resume(long remotePos,
long remoteImpliedPos,
Function<Mono<Long>,Mono<Void>> resumeFrameSent)
public Mono<Void> sendOne(ByteBuf frame)
DuplexConnectionFrame on this connection and returns the Publisher representing
the result of this send.sendOne in interface DuplexConnectionframe - Frame to send.Publisher that completes when the frame is written on the connection
successfully and errors when it fails.public Mono<Void> send(org.reactivestreams.Publisher<ByteBuf> frames)
DuplexConnectionPublisher representing
the result of this send.
Publisher mustsend in interface DuplexConnectionframes - Stream of Frames to send on the connection.Publisher that completes when all the frames are written on the connection
successfully and errors when it fails.public Flux<ByteBuf> receive()
DuplexConnectionFrames received on this connection.
Publisher MUST never emit a completion event (Subscriber.onComplete().
Publisher can error with various transport errors. If the underlying physical
connection is closed by the peer, then the returned stream from here MUST emit an
ClosedChannelException.
Publisher is not required to support multiple concurrent subscriptions.
RSocket will never have multiple subscriptions to this source. Implementations MUST
emit an IllegalStateException for subsequent concurrent subscriptions, if they do not
support multiple concurrent subscriptions.receive in interface DuplexConnectionFrames received.public long position()
public long impliedPosition()
impliedPosition in interface ResumeStateHolderpublic void onImpliedPosition(long remoteImpliedPos)
onImpliedPosition in interface ResumeStateHolderpublic Mono<Void> onClose()
CloseablePublisher that completes when this RSocket is closed. A RSocket can be closed by explicitly calling Disposable.dispose() or when the underlying
transport connection is closed.public void dispose()
dispose in interface Disposablepublic double availability()
availability in interface Availabilityavailability in interface DuplexConnectionpublic boolean isDisposed()
isDisposed in interface Disposable