@Test public void testPopWithThread() { dq.popAlways("re_allot_fans", new PopHandler() { @Override public void dealJob(Response response) throws Throwable { if (response.isSuccess()) System.out.println(JSON.toJSONString(response)); try { Thread.sleep(5000); } catch (Exception e) { e.printStackTrace(); } } }); try { Thread.sleep(120*1000); } catch (Exception e) { e.printStackTrace(); } }
public void popAlways(String channel, PopHandler handler) { PopTask task = new PopTask(this, channel, handler); taskList.add(task); popExecutor.submit(task); }
DQueue { public void popAlways(String channel, PopHandler handler) { PopTask task = new PopTask(this, channel, handler); taskList.add(task); popExecutor.submit(task); } }
DQueue { public void popAlways(String channel, PopHandler handler) { PopTask task = new PopTask(this, channel, handler); taskList.add(task); popExecutor.submit(task); } DQueue(String dqueueURI); }
DQueue { public void popAlways(String channel, PopHandler handler) { PopTask task = new PopTask(this, channel, handler); taskList.add(task); popExecutor.submit(task); } DQueue(String dqueueURI); Response add(Job job); Response delete(String key); Response finish(String key); Response popOne(String channel); void popAlways(String channel, PopHandler handler); }
DQueue { public void popAlways(String channel, PopHandler handler) { PopTask task = new PopTask(this, channel, handler); taskList.add(task); popExecutor.submit(task); } DQueue(String dqueueURI); Response add(Job job); Response delete(String key); Response finish(String key); Response popOne(String channel); void popAlways(String channel, PopHandler handler);  }