private < R > void modifyPipeLine ( final EtcdRequest < R > req , final ChannelPipeline pipeline ) { final EtcdResponseHandler < R > handler = new EtcdResponseHandler <> ( this , req ) ; if ( req . hasTimeout ( ) ) { pipeline . addFirst ( new ReadTimeoutHandler ( req . getTimeout ( ) , req . getTimeoutUnit ( ) ) ) ; } pipeline . addLast ( handler ) ; pipeline . addLast ( new ChannelHandlerAdapter ( ) { @ Override public void exceptionCaught ( ChannelHandlerContext ctx , Throwable cause ) throws Exception { handler . retried ( true ) ; req . getPromise ( ) . handleRetry ( cause ) ; } } ) ; }
Modify the pipeline for the request