public abstract class ReactorPeer<IN,OUT,CONN extends ChannelStream<IN,OUT>>
extends java.lang.Object
A Peer is network component with start and shutdown capabilities. On Start it will require a ReactorChannelHandler
to process the incoming ReactorChannel, regardless of being a server or a client.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
started |
| Modifier | Constructor and Description |
|---|---|
protected |
ReactorPeer(reactor.Environment defaultEnv,
reactor.core.Dispatcher defaultDispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec) |
protected |
ReactorPeer(reactor.Environment defaultEnv,
reactor.core.Dispatcher defaultDispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec,
long prefetch) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract reactor.rx.Promise<java.lang.Void> |
doShutdown() |
protected abstract reactor.rx.Promise<java.lang.Void> |
doStart(ReactorChannelHandler<IN,OUT,CONN> handler) |
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> |
getDefaultCodec()
Get the
Codec in use. |
reactor.core.Dispatcher |
getDefaultDispatcher() |
reactor.Environment |
getDefaultEnvironment()
Get the default environment for all Channel
|
long |
getDefaultPrefetchSize()
Get the default batch read/write size
|
reactor.rx.Promise<java.lang.Void> |
shutdown()
Shutdown this Peer and complete the returned
Promise when shut
down. |
reactor.rx.Promise<java.lang.Void> |
start(ReactorChannelHandler<IN,OUT,CONN> handler)
Start this Peer.
|
protected ReactorPeer(reactor.Environment defaultEnv,
reactor.core.Dispatcher defaultDispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec)
public final reactor.rx.Promise<java.lang.Void> start(ReactorChannelHandler<IN,OUT,CONN> handler)
Promise that will be complete when the ReactorPeer is startedpublic final reactor.rx.Promise<java.lang.Void> shutdown()
Promise when shut
down.Promise that will be complete when the ReactorPeer is shutdownpublic final reactor.core.Dispatcher getDefaultDispatcher()
public final reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> getDefaultCodec()
Codec in use.public final reactor.Environment getDefaultEnvironment()
public final long getDefaultPrefetchSize()
protected abstract reactor.rx.Promise<java.lang.Void> doStart(ReactorChannelHandler<IN,OUT,CONN> handler)
protected abstract reactor.rx.Promise<java.lang.Void> doShutdown()