public interface ChronicleChannel extends net.openhft.chronicle.core.io.Closeable, MarshallableOut, MarshallableIn
MARSHALLABLE_IN_INTERN_SIZE| Modifier and Type | Method and Description |
|---|---|
ChronicleChannelCfg |
channelCfg()
Retrieves the configuration of the channel.
|
default Runnable |
eventHandlerAsRunnable(Object eventHandler)
Creates a Runnable that reads all events from the channel and delegates them to the provided event handler.
|
ChannelHeader |
headerIn()
Retrieves the header for incoming messages.
|
ChannelHeader |
headerOut()
Retrieves the header for outgoing messages.
|
long |
lastTestMessage()
Retrieves the highest timestamp received from the test messages.
|
static ChronicleChannel |
newChannel(SocketRegistry socketRegistry,
ChronicleChannelCfg channelCfg,
ChannelHeader headerOut)
Creates a new instance of a ChronicleChannel.
|
default <T> T |
readOne(StringBuilder eventType,
Class<T> expectedType)
Reads a single event of the expected type from the channel.
|
void |
testMessage(long now)
Sends a test message using a monotonically increasing timestamp, enabling the caller to wait for a response via lastTestMessage().
|
close, closeQuietly, closeQuietlyacquireWritingDocument, builder, methodWriter, methodWriter, methodWriterBuilder, methodWriterBuilder, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeMessage, writeText, writingDocument, writingDocumentmethodReader, methodReaderBuilder, readBytes, readBytes, readDocument, readingDocument, readMap, readText, readTextstatic ChronicleChannel newChannel(SocketRegistry socketRegistry, ChronicleChannelCfg channelCfg, ChannelHeader headerOut) throws net.openhft.chronicle.core.io.InvalidMarshallableException
socketRegistry - the SocketRegistry for managing the socketchannelCfg - the ChronicleChannelCfg providing the configuration for the channelheaderOut - the ChannelHeader for outgoing messagesnet.openhft.chronicle.core.io.InvalidMarshallableException - if there's an error marshalling the objects for communicationChronicleChannelCfg channelCfg()
ChannelHeader headerOut()
ChannelHeader headerIn()
default <T> T readOne(StringBuilder eventType, Class<T> expectedType) throws net.openhft.chronicle.core.io.ClosedIORuntimeException, net.openhft.chronicle.core.io.InvalidMarshallableException
eventType - a StringBuilder object to append the event typeexpectedType - the Class of the expected event typenet.openhft.chronicle.core.io.ClosedIORuntimeException - if this ChronicleChannel has been closednet.openhft.chronicle.core.io.InvalidMarshallableException - if the Marshallable object fails to be readdefault Runnable eventHandlerAsRunnable(Object eventHandler)
eventHandler - an object that handles the processed eventsvoid testMessage(long now)
now - a monotonically increasing timestamplong lastTestMessage()
Copyright © 2023. All rights reserved.