Package io.bytestreams.exchange.core
Interface Channel
- All Known Subinterfaces:
ClientChannel<REQ,RESP>
- All Known Implementing Classes:
AbstractChannel,MultiplexedChannel,PipelinedChannel,ServerChannel,SymmetricChannel
public interface Channel
A logical messaging channel between two endpoints.
-
Method Summary
Modifier and TypeMethodDescriptionclose()Closes this channel gracefully.Returns a future that completes when this channel is fully closed, without triggering close.id()Returns a stable identifier for this channel.voidstart()Starts the channel's I/O loops.status()Returns the current lifecycle status of this channel.
-
Method Details
-
id
String id()Returns a stable identifier for this channel.- Returns:
- the channel identifier
-
status
ChannelStatus status()Returns the current lifecycle status of this channel.- Returns:
- the channel status
-
closeFuture
CompletableFuture<Void> closeFuture()Returns a future that completes when this channel is fully closed, without triggering close.- Returns:
- a read-only view of the close future
-
start
void start()Starts the channel's I/O loops. Must be called exactly once after construction.- Throws:
IllegalStateException- if the channel has already been started
-
close
CompletableFuture<Void> close()Closes this channel gracefully.- Returns:
- a future that completes when the channel is fully closed
-