@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
public ClientCnx(ClientConfigurationData conf, EventLoopGroup eventLoopGroup, int protocolVersion) { super(conf.getKeepAliveIntervalSeconds(), TimeUnit.SECONDS); checkArgument(conf.getMaxLookupRequest() > conf.getConcurrentLookupRequest()); this.pendingLookupRequestSemaphore = new Semaphore(conf.getConcurrentLookupRequest(), true); this.waitingLookupRequests = Queues .newArrayBlockingQueue((conf.getMaxLookupRequest() - conf.getConcurrentLookupRequest())); this.authentication = conf.getAuthentication(); this.eventLoopGroup = eventLoopGroup; this.maxNumberOfRejectedRequestPerConnection = conf.getMaxNumberOfRejectedRequestPerConnection(); this.operationTimeoutMs = conf.getOperationTimeoutMs(); this.state = State.None; this.isTlsHostnameVerificationEnable = conf.isTlsHostnameVerificationEnable(); this.hostnameVerifier = new DefaultHostnameVerifier(); this.protocolVersion = protocolVersion; this.timeoutTask = this.eventLoopGroup.scheduleAtFixedRate(() -> checkRequestTimeout(), operationTimeoutMs, operationTimeoutMs, TimeUnit.MILLISECONDS); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
@Override public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long l, long l1, TimeUnit timeUnit) { return delegate.scheduleAtFixedRate(runnable, l, l1, timeUnit); }
@Override public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return delegate.scheduleAtFixedRate(command, initialDelay, period, unit); }
@Override public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return delegate.scheduleAtFixedRate(command, initialDelay, period, unit); }
@Override public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) { return delegate.scheduleAtFixedRate(capturer.makeClosure(command), initialDelay, period, unit); }
@Override public void connect() { if (!isRunning()) { timer = group.scheduleAtFixedRate(this::timerTick, 200, 200, MILLISECONDS); reconnectionInfo.reset(); } CompletableFuture<Void> result = new CompletableFuture<>(); result.whenComplete((value, throwable) -> { if (throwable != null) { logger.error("Unable to connect: {}", throwable.getMessage()); } }); tasks.enqueue(new StartConnection(result, discoverer)); }
@Override public void connect() { if (!isRunning()) { timer = group.scheduleAtFixedRate(this::timerTick, 200, 200, MILLISECONDS); reconnectionInfo.reset(); } CompletableFuture<Void> result = new CompletableFuture<>(); result.whenComplete((value, throwable) -> { if (throwable != null) { logger.error("Unable to connect: {}", throwable.getMessage()); } }); tasks.enqueue(new StartConnection(result, discoverer)); }
@Override public void operationComplete(ChannelFuture channelFuture) throws Exception { if (channelFuture.isSuccess()) { channel = (DatagramChannel)channelFuture.channel(); // perform initial search request group.execute(searchRequestRunnable); // schedule two quick follow-up search requests to make sure a camera didn't miss the first request group.schedule(searchRequestRunnable, SEARCH_REQUEST_INITIAL_FREQUENCY_SECONDS, TimeUnit.SECONDS); group.schedule(searchRequestRunnable, SEARCH_REQUEST_INITIAL_FREQUENCY_SECONDS * 2, TimeUnit.SECONDS); // set up a recurring search request so we can keep track of cameras coming/going searchFuture = group.scheduleAtFixedRate( searchRequestRunnable, SEARCH_REQUEST_INITIAL_FREQUENCY_SECONDS * 2 + getSearchRequestFrequencySeconds, getSearchRequestFrequencySeconds, TimeUnit.SECONDS ); } else { logger.error("Bind attempt failed", channelFuture.cause()); } } });
this.housekeepingFuture = this.bossGroup.scheduleAtFixedRate(this.sessionManager::doHousekeeping, HOUSEKEEPING_INTERVAL, HOUSEKEEPING_INTERVAL, TimeUnit.MILLISECONDS);
bootstrapUDT.childGroup().scheduleAtFixedRate(new Runnable() {
this.keepAliveFuture = peerEventLoopGroup.scheduleAtFixedRate((Runnable) peer::keepAlivePing, initialDelay, config.getKeepAlivePeriodSeconds(), SECONDS); this.timeoutPingsFuture = peerEventLoopGroup.scheduleAtFixedRate((Runnable) peer::timeoutPings, 0, 100, TimeUnit.MILLISECONDS);
private void stop0(CompletableFuture<Void> future) { Objects.requireNonNull(future); final EventLoopGroup bossGroup = this.bossGroup; final GracefulShutdownSupport gracefulShutdownSupport = this.gracefulShutdownSupport; if (gracefulShutdownSupport == null) { stop1(future, bossGroup); return; } // Check every 100 ms for the server to have completed processing // requests. final ScheduledFuture<?> quietPeriodFuture = bossGroup.scheduleAtFixedRate(() -> { if (gracefulShutdownSupport.completedQuietPeriod()) { stop1(future, bossGroup); } }, 0, 100, TimeUnit.MILLISECONDS); // Make sure the event loop stops after the timeout, regardless of what // the GracefulShutdownSupport says. bossGroup.schedule(() -> { quietPeriodFuture.cancel(false); stop1(future, bossGroup); }, config.gracefulShutdownTimeout().toMillis(), TimeUnit.MILLISECONDS); }
bootstrapUDTClient.group().scheduleAtFixedRate(new Runnable() {