I
- The type of the object that is read from this connection.O
- The type of objects that are written to this connection.public class ObservableConnection<I,O> extends DefaultChannelWriter<O>
Modifier and Type | Field and Description |
---|---|
protected long |
closeStartTimeMillis |
closeIssued, CONNECTION_ALREADY_CLOSED
Modifier | Constructor and Description |
---|---|
protected |
ObservableConnection(io.netty.channel.Channel channel,
ChannelMetricEventProvider metricEventProvider,
MetricEventsSubject<?> eventsSubject) |
Modifier and Type | Method and Description |
---|---|
protected rx.Observable<java.lang.Void> |
_close(boolean flush) |
protected rx.Observable<java.lang.Void> |
_closeChannel() |
rx.Observable<java.lang.Void> |
close()
Closes this connection.
|
static <I,O> ObservableConnection<I,O> |
create(io.netty.channel.Channel channel,
MetricEventsSubject<?> eventsSubject,
ChannelMetricEventProvider metricEventProvider) |
protected void |
fireNewRxConnectionEvent()
Fires a
NewRxConnectionEvent for this connection. |
rx.Observable<I> |
getInput() |
protected void |
updateInputSubject(rx.subjects.Subject<I,I> newSubject) |
cancelPendingWrites, close, flush, getAllocator, getChannel, isCloseIssued, write, write, writeAndFlush, writeAndFlush, writeBytes, writeBytes, writeBytesAndFlush, writeBytesAndFlush, writeFileRegion, writeOnChannel, writeString, writeStringAndFlush
protected ObservableConnection(io.netty.channel.Channel channel, ChannelMetricEventProvider metricEventProvider, MetricEventsSubject<?> eventsSubject)
public rx.Observable<I> getInput()
public static <I,O> ObservableConnection<I,O> create(io.netty.channel.Channel channel, MetricEventsSubject<?> eventsSubject, ChannelMetricEventProvider metricEventProvider)
protected void fireNewRxConnectionEvent()
NewRxConnectionEvent
for this connection.
This must only be called before passing the connection instance to any other code. The reason why this is
not done as part of the constructor is that NewRxConnectionEvent
requires the ObservableConnection
instance which when sending from the constructor will escape "this"public rx.Observable<java.lang.Void> close()
close
in interface ChannelWriter<O>
close
in class DefaultChannelWriter<O>
Observable.error(Throwable)
if the
close is already issued (may not be completed)protected rx.Observable<java.lang.Void> _close(boolean flush)
_close
in class DefaultChannelWriter<O>
protected rx.Observable<java.lang.Void> _closeChannel()