public class EchoHandler extends AbstractHandler<EchoHandler>
AbstractHandler, and implements the `run` and `asInternalChannel` methods
for specific behavior.
This handler acquires an AffinityLock before running, and releases it after
the ChronicleChannel is closed. While the channel is open, it continuously reads incoming data,
echoing it back to the sender.
When there is no data available, it invokes the Pauser to pause execution,
reducing the CPU usage when idle. If data is available, it resets the pauser to wake up immediately
the next time it checks for data.
EMPTYDISCARD| Constructor and Description |
|---|
EchoHandler() |
| Modifier and Type | Method and Description |
|---|---|
ChronicleChannel |
asInternalChannel(ChronicleContext context,
ChronicleChannelCfg channelCfg)
Returns an
EchoChannel as the internal channel for this handler. |
void |
run(ChronicleContext context,
ChronicleChannel channel)
Executes the main logic of this EchoHandler, which continuously reads incoming data from the
provided channel and echoes it back to the sender.
|
buffered, bufferedsessionName, sessionName, systemContext, systemContextusesSelfDescribingMessageequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcloseWhenRunEnds, recordHistory, responseHeadersessionName, sessionName, systemContext, systemContext$equals, $fieldInfoMap, $fieldInfos, $hashCode, $toString, className, copyTo, deepCopy, fromFile, fromFile, fromString, fromString, fromString, getField, getLongField, mergeToMap, readMarshallable, reset, setField, setLongField, streamFromFile, streamFromFile, writeMarshallablebinaryLengthLength, writeValueunexpectedFieldpublic void run(ChronicleContext context, ChronicleChannel channel) throws net.openhft.chronicle.core.io.ClosedIORuntimeException, net.openhft.chronicle.core.io.InvalidMarshallableException
context - the ChronicleContext in which this handler operateschannel - the ChronicleChannel from which to read the datanet.openhft.chronicle.core.io.ClosedIORuntimeException - if the channel is closed unexpectedlynet.openhft.chronicle.core.io.InvalidMarshallableException - if there's an issue while processing the datapublic ChronicleChannel asInternalChannel(ChronicleContext context, ChronicleChannelCfg channelCfg)
EchoChannel as the internal channel for this handler.context - the ChronicleContext in which this handler operateschannelCfg - the ChronicleChannelCfg that configures the channelCopyright © 2023. All rights reserved.