大屏接口
parent
6651512736
commit
08df3092c2
@ -1,20 +0,0 @@
|
||||
package com.kiisoo.ic.job.count;
|
||||
|
||||
import com.lmax.disruptor.EventTranslator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class CountDTOMessageEventTranslator implements EventTranslator<CountDTOMessage> {
|
||||
|
||||
private Random random = new Random();
|
||||
|
||||
private CountDTOMessage generateTradeTransaction(CountDTOMessage trade) {
|
||||
// System.out.println("DTOMessageEventTranslator" + trade.toString());
|
||||
return trade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateTo(CountDTOMessage countDtoMessage, long l) {
|
||||
this.generateTradeTransaction(countDtoMessage);
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.kiisoo.ic.job.count;
|
||||
|
||||
import com.lmax.disruptor.dsl.Disruptor;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
public class CountDTOMessagePublish implements Runnable {
|
||||
private Disruptor<CountDTOMessage> disruptor;
|
||||
private CountDownLatch latch;
|
||||
|
||||
public CountDTOMessagePublish(Disruptor<CountDTOMessage> disruptor, CountDownLatch latch) {
|
||||
this.disruptor = disruptor;
|
||||
this.latch = latch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
disruptor.publishEvent(new CountDTOMessageEventTranslator());
|
||||
}
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.kiisoo.ic.job.detail;
|
||||
|
||||
import com.lmax.disruptor.dsl.Disruptor;
|
||||
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
public class DTOMessagePublish implements Runnable {
|
||||
private Disruptor<DetailDTOMessage> disruptor;
|
||||
private CountDownLatch latch;
|
||||
|
||||
public DTOMessagePublish(Disruptor<DetailDTOMessage> disruptor, CountDownLatch latch) {
|
||||
this.disruptor = disruptor;
|
||||
this.latch = latch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
disruptor.publishEvent(new DetailDTOMessageEventTranslator());
|
||||
}
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.kiisoo.ic.job.detail;
|
||||
|
||||
import com.lmax.disruptor.EventTranslator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class DetailDTOMessageEventTranslator implements EventTranslator<DetailDTOMessage> {
|
||||
|
||||
private Random random = new Random();
|
||||
|
||||
private DetailDTOMessage generateTradeTransaction(DetailDTOMessage trade) {
|
||||
// System.out.println("DTOMessageEventTranslator" + trade.toString());
|
||||
return trade;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translateTo(DetailDTOMessage detailDtoMessage, long l) {
|
||||
this.generateTradeTransaction(detailDtoMessage);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue