Package io.reactivex.netty.util

Examples of io.reactivex.netty.util.MultipleFutureListener


        final ResponseState stateToUse = responseState;

        if (HttpClientRequest.class.isAssignableFrom(recievedMsgClass)) {
            HttpClientRequest<?> rxRequest = (HttpClientRequest<?>) msg;
            MultipleFutureListener allWritesListener = new MultipleFutureListener(promise);

            Observable<?> contentSource = null;

            switch (rxRequest.getContentSourceType()) {
                case Raw:
View Full Code Here


        this.metricEventProvider = metricEventProvider;
        if (null == nettyChannel) {
            throw new NullPointerException("Channel can not be null.");
        }
        this.nettyChannel = nettyChannel;
        unflushedWritesListener = new AtomicReference<MultipleFutureListener>(new MultipleFutureListener(nettyChannel.newPromise()));
    }
View Full Code Here

    @Override
    @SuppressWarnings("unchecked")
    public Observable<Void> flush() {
        final long startTimeMillis = Clock.newStartTimeMillis();
        eventsSubject.onEvent(metricEventProvider.getFlushStartEvent());
        MultipleFutureListener existingListener =
                unflushedWritesListener.getAndSet(new MultipleFutureListener(nettyChannel.newPromise()));
        /**
         * Do flush() after getting the last listener so that we do not wait for a write which is not flushed.
         * If we do it before getting the existingListener then the write that happens after the flush() from the user
         * will be contained in the retrieved listener and hence we will wait till the next flush() finish.
         */
        nettyChannel.flush();
        return existingListener.asObservable()
                               .doOnCompleted(new Action0() {
                                   @Override
                                   public void call() {
                                       eventsSubject.onEvent(metricEventProvider.getFlushSuccessEvent(),
                                                             Clock.onEndMillis(startTimeMillis));
View Full Code Here

TOP

Related Classes of io.reactivex.netty.util.MultipleFutureListener

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.