提交 f7ff8047 编写于 作者: X xueli.xue

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

上级 5c2bcb9f
......@@ -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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册