Package org.asynchttpclient.providers.netty

Examples of org.asynchttpclient.providers.netty.Callback.call()


                        // FIXME investigate this
                        Channels.setAttribute(channel, callback);
                    } else {
                        // FIXME don't understand: this offers the connection to the pool, or even closes it, while the
                        // request has not been sent, right?
                        callback.call();
                    }

                    Request redirectRequest = requestBuilder.setUrl(newUrl).build();
                    // FIXME why not reuse the channel is same host?
                    requestSender.sendNextRequest(redirectRequest, future);
View Full Code Here


        Channel channel = ctx.channel();
        Object attribute = Channels.getAttribute(channel);

        if (attribute instanceof Callback && msg instanceof LastHttpContent) {
            Callback ac = (Callback) attribute;
            ac.call();
            Channels.setAttribute(channel, DiscardEvent.INSTANCE);

        } else if (attribute instanceof NettyResponseFuture) {
            NettyResponseFuture<?> future = (NettyResponseFuture<?>) attribute;
            protocol.handle(channel, future, msg);
View Full Code Here

        LOGGER.debug("Channel Closed: {} with attribute {}", channel, attribute);

        if (attribute instanceof Callback) {
            Callback callback = (Callback) attribute;
            Channels.setAttribute(channel, callback.future());
            callback.call();

        } else if (attribute instanceof NettyResponseFuture<?>) {
            NettyResponseFuture<?> future = NettyResponseFuture.class.cast(attribute);
            future.touch();
View Full Code Here

                    // We must make sure there is no bytes left
                    // before executing the next request.
                    Channels.setAttribute(channel, callback);
                else
                    // call might crash with an IOException
                    callback.call();

                return true;
            }
        }
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.