title: Sharing one instance of HashedWheelTimer
body: <p>In this question </p>
  
  <p><a href="https://stackoverflow.com/questions/8873825/netty-comet-async-request-time-out">Netty Comet Async request time out</a></p>
  
  <p>It was suggested to me, to share one instance of <code>HashedWheelTimer</code> between pipelines. </p>
  
  <p>My current code looks like this</p>
  
  <pre><code>@Override
      public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = Channels.pipeline();
       pipeline.addLast("decoder", new HttpRequestDecoder());
       pipeline.addLast("encoder", new HttpResponseEncoder());
       pipeline.addLast("handler", new HTTPRequestHandler());
       Timer timer = new HashedWheelTimer();
       pipeline.addLast("timeout", new IdleStateHandler(timer, 30, 30, 0));
      return pipeline; 
  </code></pre>
  
  <p>As far as I ca see I do share one instance of <code>HashedWheelTimer</code> between pipeline, but create new instance of <code>IdleStateHandler</code> each time. </p>
  
  <p>Is it wrong? Can anybody help me on how to do it correctly? Should I make instances of <code>IdleStateHandler</code> and <code>HashedWheelTimer</code> static?</p>