Skip to content

Commit

Permalink
Merge pull request square#503 from normanmaurer/pooled
Browse files Browse the repository at this point in the history
Use the pooled allocator for performance reasons
  • Loading branch information
Adrian Cole committed Feb 2, 2014
2 parents 810a917 + 18ef05d commit a12d6a6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import com.squareup.okhttp.internal.Util;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
Expand Down Expand Up @@ -81,6 +83,7 @@ class NettyHttpClient implements HttpClient {
EventLoopGroup group = new NioEventLoopGroup();
bootstrap = new Bootstrap();
bootstrap.group(group)
.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
.channel(NioSocketChannel.class)
.handler(channelInitializer);
}
Expand Down

0 comments on commit a12d6a6

Please sign in to comment.