Package com.taobao.zeus.socket.worker.reqresp

Examples of com.taobao.zeus.socket.worker.reqresp.WorkerHeartBeat


    context.setClientWorker(this);
    context.setApplicationContext(applicationContext);
    // 定时发送心跳
    ScheduledExecutorService service = Executors.newScheduledThreadPool(2);
    service.scheduleAtFixedRate(new Runnable() {
      private WorkerHeartBeat heartbeat = new WorkerHeartBeat();
      private int failCount = 0;

      @Override
      public void run() {
        try {
          if (context.getServerChannel() == null) {
            return;
          }
          ChannelFuture cf = heartbeat.execute(context);
          cf.addListener(new ChannelFutureListener() {
            public void operationComplete(ChannelFuture future)
                throws Exception {
              if (!future.isSuccess()) {
                failCount++;
View Full Code Here

TOP

Related Classes of com.taobao.zeus.socket.worker.reqresp.WorkerHeartBeat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.