Package io.adamantic.quicknote
Interface Channel
- All Superinterfaces:
AutoCloseable
Represents a channel for sending or receiving messages.
While nothing prevents having full-duplex channels, we generally find
it more useful to have separate channels for sending and receiving messages.
This interface is used to abstract the underlying transport protocol.
- Author:
- Domenico Barra - domenico@adamantic.io
-
Method Summary
-
Method Details
-
name
String name()The name of the channel. This is used to identify the channel in the system, configuration, and logs.- Returns:
- the name of the channel.
-
open
Opens the channel for sending or receiving messages.- Throws:
IOException- if the channel cannot be opened.
-
close
void close()Closes the channel. It is a requirement that this method be idempotent and not throw any exceptions.- Specified by:
closein interfaceAutoCloseable
-
state
ChannelState state()Returns the state of the channel.- Returns:
- the state of the channel.
-