Package io.servicetalk.transport.api
Interface ConnectionObserver.ReadObserver
- All Known Implementing Classes:
NoopTransportObserver.NoopReadObserver
- Enclosing interface:
- ConnectionObserver
public static interface ConnectionObserver.ReadObserver
An observer interface that provides visibility into read events.
Either readComplete()
or readFailed(Throwable)
will be invoked to signal when a read operation
terminates. readCancelled()
is also a terminal signal for the read operation, however it may be invoked
concurrently with readComplete()
or readFailed(Throwable)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
itemRead()
Deprecated.void
Invokes when a new item is read.void
Callback when the read operation is cancelled.void
Callback when the entire read operation completes successfully.void
readFailed
(Throwable cause) Callback when the read operation fails with anerror
.void
requestedToRead
(long n) Callback when new items are requested to read.
-
Method Details
-
requestedToRead
void requestedToRead(long n) Callback when new items are requested to read.- Parameters:
n
- number of requested items to read
-
itemRead
Deprecated.UseitemRead(Object)
Invokes when a new item is read.Content of the read items should be inspected at the higher level API when these items are consumed.
-
itemRead
Invokes when a new item is read.- Parameters:
item
- an item that was read
-
readFailed
Callback when the read operation fails with anerror
.- Parameters:
cause
-Throwable
that terminated the read
-
readComplete
void readComplete()Callback when the entire read operation completes successfully. -
readCancelled
void readCancelled()Callback when the read operation is cancelled.
-
itemRead(Object)