Latency issue while accessing server in multiple threads

javadevmtl java.dev.mtl at gmail.com
Thu Aug 19 10:34:56 EDT 2010


Try to put an ExecutionHandler in your pipeline before your handler... This
works well for client/server application/protocols that open and close
connections as needed

Part of my pipeline...
public class MyPipelineFactory implements ChannelPipelineFactory {

	private final ExecutionHandler executionHandler;
	
	// Make sure to init the MemoryAwareExecutionHandler or
OrderedMemoryAwareExecutionHandler outside the pipeline and pass it in the
constructor.
public MyPipelineFactory(ExecutionHandler executionHandler)
	{
		this.executionHandler = executionHandler;
	}
	
	@Override
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = Channels.pipeline();

		pipeline.addLast("framer", new
MyFrameDecoder(Constants.DefaultLengthHeader));
		pipeline.addLast("threaded", executionHandler);
		pipeline.addLast("MyHandler", new MyHandler());

		return pipeline;
	}
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Latency-issue-while-accessing-server-in-multiple-threads-tp5428086p5440566.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list