Search in sources :

Example 16 with ConnectionObserver

use of reactor.netty.ConnectionObserver in project reactor-netty by reactor.

the class QuicTransport method streamObserve.

/**
 * Set or add the given {@link ConnectionObserver} for each stream
 *
 * @param observer the {@link ConnectionObserver} addition
 * @return a {@link QuicTransport} reference
 */
public T streamObserve(ConnectionObserver observer) {
    Objects.requireNonNull(observer, "observer");
    T dup = duplicate();
    ConnectionObserver current = configuration().streamObserver;
    dup.configuration().streamObserver = current == null ? observer : current.then(observer);
    return dup;
}
Also used : ConnectionObserver(reactor.netty.ConnectionObserver)

Aggregations

ConnectionObserver (reactor.netty.ConnectionObserver)16 Connection (reactor.netty.Connection)9 InetSocketAddress (java.net.InetSocketAddress)7 SocketAddress (java.net.SocketAddress)7 Duration (java.time.Duration)6 Mono (reactor.core.publisher.Mono)5 EventLoopGroup (io.netty.channel.EventLoopGroup)4 AddressResolverGroup (io.netty.resolver.AddressResolverGroup)4 Supplier (java.util.function.Supplier)4 ConnectionProvider (reactor.netty.resources.ConnectionProvider)4 LoopResources (reactor.netty.resources.LoopResources)4 Channel (io.netty.channel.Channel)3 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)3 List (java.util.List)3 Objects (java.util.Objects)3 TimeUnit (java.util.concurrent.TimeUnit)3 Test (org.junit.jupiter.api.Test)3 CoreSubscriber (reactor.core.CoreSubscriber)3 PooledConnection (reactor.netty.resources.DefaultPooledConnectionProvider.PooledConnection)3 TransportConfig (reactor.netty.transport.TransportConfig)3