예제 #1
0
 public static void main(String[] arg) {
   DelayRunner.getInstance().start();
   //        DelayRunner.getInstance().startSession("recommend_id",);
   //        DelayRunner.getInstance().startSession("list_channel_id");
   for (int i = 0; i < 100; i++) {
     try {
       Thread.sleep(10000);
     } catch (InterruptedException e) {
       e.printStackTrace();
       break;
     }
   }
   DelayRunner.getInstance().stopDelayRunner();
 }
예제 #2
0
 // 定义获取该线程的静态实例,当该线程没有启动时,则立即启动它
 public static DelayRunner getInstance() {
   if (!instance.isAlive()) {
     instance.start();
   }
   return instance;
 }