Commit 3ae87fc1 authored by Florian Fittkau's avatar Florian Fittkau

WiP

parent 643a2166
......@@ -24,25 +24,26 @@ public final class TCPReader implements IPeriodicTimeSignalReceiver {
private final PipesMerger<IRecord> merger;
private final Queue<IRecord> periodicSignalQueue;
public TCPReader(final int listeningPort, final PipesMerger<IRecord> traceReconstructionMerger) {
this.listeningPort = listeningPort;
merger = traceReconstructionMerger;
new TimeSignalReader(TimeUnit.SECONDS.toMillis(1), this).start();
periodicSignalQueue = merger.registerProducer();
}
@Override
public void periodicTimeSignal(final long timestamp) {
final Queue<IRecord> queue = merger.registerProducer();
final TimedPeriodRecord periodRecord = new TimedPeriodRecord();
while (!queue.offer(periodRecord)) {
while (!periodicSignalQueue.offer(periodRecord)) {
try {
Thread.sleep(1);
} catch (final InterruptedException e) {
}
}
merger.deregisterProducer(queue);
}
public final void read() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment