Examples of OneTimeTask


Examples of io.netty.util.internal.OneTimeTask

        } else {
            /**
             * use unwrap(), because the executor will usually be a {@link PausableEventExecutor}
             * that might not accept any new tasks.
             */
            executor().unwrap().execute(new OneTimeTask() {
                @Override
                public void run() {
                    teardown0();
                }
            });
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

                promise.setSuccess();
            } catch (Throwable t) {
                promise.setFailure(t);
            }
        } else {
            loop.execute(new OneTimeTask() {
                @Override
                public void run() {
                    shutdownOutput(promise);
                }
            });
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

        }

        // Schedule a query timeout task if necessary.
        final long queryTimeoutMillis = parent.queryTimeoutMillis();
        if (queryTimeoutMillis > 0) {
            timeoutFuture = parent.ch.eventLoop().schedule(new OneTimeTask() {
                @Override
                public void run() {
                    if (promise.isDone()) {
                        // Received a response before the query times out.
                        return;
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

            oldEntry.release();
        }

        boolean scheduled = false;
        try {
            entry.expirationFuture = ch.eventLoop().schedule(new OneTimeTask() {
                @Override
                public void run() {
                    clearCache(question);
                }
            }, delaySeconds, TimeUnit.SECONDS);
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

     * the {@link #connectPromise} as failure if the connection attempt does not success within the timeout.
     */
    private void sendInitialMessage(final ChannelHandlerContext ctx) throws Exception {
        final long connectTimeoutMillis = this.connectTimeoutMillis;
        if (connectTimeoutMillis > 0) {
            connectTimeoutFuture = ctx.executor().schedule(new OneTimeTask() {
                @Override
                public void run() {
                    if (!connectPromise.isDone()) {
                        setConnectFailure(new ProxyConnectException(exceptionMessage("timeout")));
                    }
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

        @Override
        public void deregister(ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
            assert !((PausableEventExecutor) ctx.channel().eventLoop()).isAcceptingNewTasks();

            // submit deregistration task
            ctx.channel().eventLoop().unwrap().execute(new OneTimeTask() {
                @Override
                public void run() {
                    unsafe.deregister(promise);
                }
            });
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

                    requestedRemoteAddress = remoteAddress;

                    // Schedule connect timeout.
                    int connectTimeoutMillis = config().getConnectTimeoutMillis();
                    if (connectTimeoutMillis > 0) {
                        connectTimeoutFuture = eventLoop().schedule(new OneTimeTask() {
                            @Override
                            public void run() {
                                ChannelPromise connectPromise = AbstractNioChannel.this.connectPromise;
                                ConnectTimeoutException cause =
                                        new ConnectTimeoutException("connection timed out: " + remoteAddress);
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

            if (eventLoop.inEventLoop()) {
                register0(promise);
            } else {
                try {
                    eventLoop.execute(new OneTimeTask() {
                        @Override
                        public void run() {
                            register0(promise);
                        }
                    });
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

                closeIfClosed();
                return;
            }

            if (!wasActive && isActive()) {
                invokeLater(new OneTimeTask() {
                    @Override
                    public void run() {
                        pipeline.fireChannelActive();
                    }
                });
View Full Code Here

Examples of io.netty.util.internal.OneTimeTask

                closeIfClosed();
                return;
            }

            if (wasActive && !isActive()) {
                invokeLater(new OneTimeTask() {
                    @Override
                    public void run() {
                        pipeline.fireChannelInactive();
                    }
                });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.