Class TestRelayProcessorWorker<ValueT>
java.lang.Object
io.aleph0.yap.messaging.test.TestRelayProcessorWorker<ValueT>
- Type Parameters:
ValueT- the type of the value to process
- All Implemented Interfaces:
io.aleph0.yap.core.Measureable<RelayMetrics>,io.aleph0.yap.core.ProcessorWorker<ValueT,,ValueT> io.aleph0.yap.core.worker.MeasuredProcessorWorker<ValueT,,ValueT, RelayMetrics> RelayProcessorWorker<ValueT>
public class TestRelayProcessorWorker<ValueT>
extends Object
implements RelayProcessorWorker<ValueT>
A
relay processor that simulates a "real" relay processor by
delaying the processing of messages. This is useful for testing and debugging purposes, as it
allows you to simulate the behavior of a relay processor without actually sending the messages
anywhere.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newTestRelayProcessorWorkerwith the default scheduler.TestRelayProcessorWorker(Scheduler scheduler) Creates a newTestRelayProcessorWorkerwith the given scheduler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
-
Constructor Details
-
TestRelayProcessorWorker
public TestRelayProcessorWorker()Creates a newTestRelayProcessorWorkerwith the default scheduler.- See Also:
-
TestRelayProcessorWorker
Creates a newTestRelayProcessorWorkerwith the given scheduler.- Parameters:
scheduler- the scheduler to use
-
-
Method Details
-
process
public void process(io.aleph0.yap.core.Source<ValueT> source, io.aleph0.yap.core.Sink<ValueT> sink) throws IOException, InterruptedException - Specified by:
processin interfaceio.aleph0.yap.core.ProcessorWorker<ValueT,ValueT> - Throws:
IOExceptionInterruptedException
-
checkMetrics
- Specified by:
checkMetricsin interfaceio.aleph0.yap.core.Measureable<ValueT>
-
flushMetrics
- Specified by:
flushMetricsin interfaceio.aleph0.yap.core.Measureable<ValueT>
-