Java Code Examples for reactor.netty.ConnectionObserver#then()

The following examples show how to use reactor.netty.ConnectionObserver#then() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Transport.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
/**
 * Set or add the given {@link ConnectionObserver} to observe the connection state changes.
 *
 * @param observer the {@link ConnectionObserver} to be set or add
 * @return a new {@link Transport} reference
 */
public T observe(ConnectionObserver observer) {
	Objects.requireNonNull(observer, "observer");
	T dup = duplicate();
	ConnectionObserver current = configuration().observer;
	dup.configuration().observer = current == null ? observer : current.then(observer);
	return dup;
}
 
Example 2
Source File: ServerTransport.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
/**
 * Set or add the given {@link ConnectionObserver} for each remote connection
 *
 * @param observer the {@link ConnectionObserver} addition
 * @return a new {@link ServerTransport} reference
 */
public T childObserve(ConnectionObserver observer) {
	Objects.requireNonNull(observer, "observer");
	T dup = duplicate();
	ConnectionObserver current = configuration().childObserver;
	dup.configuration().childObserver = current == null ? observer : current.then(observer);
	return dup;
}