io.netty.channel.EventLoop.scheduleWithFixedDelay()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(282)

本文整理了Java中io.netty.channel.EventLoop.scheduleWithFixedDelay()方法的一些代码示例,展示了EventLoop.scheduleWithFixedDelay()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventLoop.scheduleWithFixedDelay()方法的具体详情如下:
包路径:io.netty.channel.EventLoop
类名称:EventLoop
方法名:scheduleWithFixedDelay

EventLoop.scheduleWithFixedDelay介绍

暂无

代码示例

代码示例来源:origin: ReactiveX/RxNetty

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay,
                         long delay,
                         TimeUnit unit) {
  return next().scheduleWithFixedDelay(command, initialDelay, delay, unit);
}

代码示例来源:origin: apache/pulsar

public PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, ConsumerConfigurationData<?> conf,
                        EventLoopGroup eventLoopGroup) {
  this.consumer = consumer;
  this.pendingIndividualAcks = new ConcurrentSkipListSet<>();
  this.acknowledgementGroupTimeMicros = conf.getAcknowledgementsGroupTimeMicros();
  if (acknowledgementGroupTimeMicros > 0) {
    scheduledTask = eventLoopGroup.next().scheduleWithFixedDelay(this::flush, acknowledgementGroupTimeMicros,
        acknowledgementGroupTimeMicros, TimeUnit.MICROSECONDS);
  } else {
    scheduledTask = null;
  }
}

代码示例来源:origin: lets-blade/blade

private void sessionCleaner() {
  if (null != blade.sessionManager()) {
    scheduleEventLoop.
        scheduleWithFixedDelay(new SessionCleaner(blade.sessionManager()),
            1000, 1000, TimeUnit.MILLISECONDS);
  }
}

代码示例来源:origin: lets-blade/blade

private void sessionCleaner() {
  if (null != blade.sessionManager()) {
    scheduleEventLoop.
        scheduleWithFixedDelay(new SessionCleaner(blade.sessionManager()),
            1000, 1000, TimeUnit.MILLISECONDS);
  }
}

代码示例来源:origin: line/armeria

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(
    Runnable command, long initialDelay, long delay, TimeUnit unit) {
  return delegate().scheduleWithFixedDelay(
      context().makeContextAware(command), initialDelay, delay, unit);
}

代码示例来源:origin: KittehOrg/KittehIRCClientLib

/**
 * Starts sending pings.
 */
public void startPing() {
  this.ping = this.channel.eventLoop().scheduleWithFixedDelay(this.client::ping, 60, 60, TimeUnit.SECONDS);
}

代码示例来源:origin: reactor/reactor-netty

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
    long initialDelay,
    long delay,
    TimeUnit unit) {
  return next().scheduleWithFixedDelay(command, initialDelay, delay, unit);
}

代码示例来源:origin: io.projectreactor.netty/reactor-netty

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
    long initialDelay,
    long delay,
    TimeUnit unit) {
  return next().scheduleWithFixedDelay(command, initialDelay, delay, unit);
}

代码示例来源:origin: io.projectreactor.ipc/reactor-netty

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
    long initialDelay,
    long delay,
    TimeUnit unit) {
  return next().scheduleWithFixedDelay(command, initialDelay, delay, unit);
}

代码示例来源:origin: io.projectreactor/reactor-netty

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command,
    long initialDelay,
    long delay,
    TimeUnit unit) {
  return next().scheduleWithFixedDelay(command, initialDelay, delay, unit);
}

代码示例来源:origin: spotify/folsom

ConnectionHandler() {
 final long pollIntervalMillis = Math.min(timeoutMillis, SECONDS.toMillis(1));
 timeoutCheckTask =
   channel
     .eventLoop()
     .scheduleWithFixedDelay(
       () -> {
        final Request<?> head = outstanding.peek();
        if (head == null) {
         return;
        }
        if (timeoutChecker.check(head)) {
         log.error("Request timeout: {} {}", channel, head);
         DefaultRawMemcacheClient.this.setDisconnected("Timeout");
        }
       },
       pollIntervalMillis,
       pollIntervalMillis,
       MILLISECONDS);
}

代码示例来源:origin: org.apache.pulsar/pulsar-client-original

public PersistentAcknowledgmentsGroupingTracker(ConsumerImpl<?> consumer, ConsumerConfigurationData<?> conf,
                        EventLoopGroup eventLoopGroup) {
  this.consumer = consumer;
  this.pendingIndividualAcks = new ConcurrentSkipListSet<>();
  this.acknowledgementGroupTimeMicros = conf.getAcknowledgementsGroupTimeMicros();
  if (acknowledgementGroupTimeMicros > 0) {
    scheduledTask = eventLoopGroup.next().scheduleWithFixedDelay(this::flush, acknowledgementGroupTimeMicros,
        acknowledgementGroupTimeMicros, TimeUnit.MICROSECONDS);
  } else {
    scheduledTask = null;
  }
}

代码示例来源:origin: aadnk/ProtocolLib

@Override
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable action, long arg1, long arg2, TimeUnit arg3) {
  return getDelegate().scheduleWithFixedDelay(schedulingRunnable(action), arg1, arg2, arg3);
}

代码示例来源:origin: pravega/pravega

@Override
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
  super.channelRegistered(ctx);
  Channel c = ctx.channel();
  channel.set(c);
  registeredFutureLatch.release(null); //release all futures waiting for channel registration to complete.
  log.info("Connection established {} ", ctx);
  c.write(new WireCommands.Hello(WireCommands.WIRE_VERSION, WireCommands.OLDEST_COMPATIBLE_VERSION), c.voidPromise());
  ScheduledFuture<?> old = keepAliveFuture.getAndSet(c.eventLoop().scheduleWithFixedDelay(new KeepAliveTask(), 20, 10, TimeUnit.SECONDS));
  if (old != null) {
    old.cancel(false);
  }
}

代码示例来源:origin: com.bladejava/blade-mvc

private void sessionCleaner() {
  if (null != blade.sessionManager()) {
    scheduleEventLoop.
        scheduleWithFixedDelay(new SessionCleaner(blade.sessionManager()),
            1000, 1000, TimeUnit.MILLISECONDS);
  }
}

相关文章