Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2011-2013 GoPivotal, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package reactor.tcp;
import reactor.core.Environment;
import reactor.core.Reactor;
import reactor.core.composable.Deferred;
import reactor.core.composable.Promise;
import reactor.core.composable.Stream;
import reactor.core.composable.spec.Promises;
import reactor.core.composable.spec.Streams;
import reactor.core.spec.Reactors;
import reactor.core.support.NotifyConsumer;
import reactor.event.Event;
import reactor.event.dispatch.Dispatcher;
import reactor.event.registry.Registration;
import reactor.event.selector.Selector;
import reactor.event.selector.Selectors;
import reactor.event.support.EventConsumer;
import reactor.function.Consumer;
import reactor.function.Function;
import reactor.function.batch.BatchConsumer;
import reactor.io.Buffer;
import reactor.queue.BlockingQueueFactory;
import reactor.tcp.encoding.Codec;
import reactor.tuple.Tuple2;
import java.util.NoSuchElementException;
import java.util.Queue;
import static reactor.event.selector.Selectors.$;
/**
* Implementations of this class should provide concrete functionality for doing real IO.
*
* @param
* The type that will be received by this connection
* @param
* The type that will be sent by this connection
*
* @author Jon Brisbin
*/
public abstract class AbstractTcpConnection implements TcpConnection {
protected final long created = System.currentTimeMillis();
protected final Tuple2 read = $();
protected final Environment env;
protected final Dispatcher ioDispatcher;
protected final Reactor ioReactor;
protected final Reactor eventsReactor;
protected final Function decoder;
protected final Function encoder;
protected final Queue