任务执行队列,采用Poll(Timeout)方式;

v1.4
xueli.xue 9 years ago
parent 5c2bcb9ffd
commit f7ff804739

@ -13,6 +13,7 @@ import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
/**
* handler thread
@ -55,7 +56,7 @@ public class HandlerThread extends Thread{
public void run() {
while(!toStop){
try {
Map<String, String> handlerData = handlerDataQueue.take();
Map<String, String> handlerData = handlerDataQueue.poll(3L, TimeUnit.SECONDS);
if (handlerData!=null) {
i= 0;
String log_address = handlerData.get(HandlerParamEnum.LOG_ADDRESS.name());

Loading…
Cancel
Save