use of org.webpieces.nio.api.ChannelManagerFactory in project webpieces by deanhiller.
the class HttpClientFactory method createHttpClient.
public static HttpClient createHttpClient(int numThreads) {
Executor executor = Executors.newFixedThreadPool(numThreads, new NamedThreadFactory("httpclient"));
BufferCreationPool pool = new BufferCreationPool();
HttpParser parser = HttpParserFactory.createParser(pool);
ChannelManagerFactory factory = ChannelManagerFactory.createFactory();
ChannelManager mgr = factory.createMultiThreadedChanMgr("httpClientChanMgr", pool, executor);
return createHttpClient(mgr, parser);
}
use of org.webpieces.nio.api.ChannelManagerFactory in project webpieces by deanhiller.
the class Http2ClientFactory method createHttpClient.
public static Http2Client createHttpClient(int numThreads) {
Http2Config config = new Http2Config();
Executor executor = Executors.newFixedThreadPool(numThreads, new NamedThreadFactory("httpclient"));
BufferCreationPool pool = new BufferCreationPool();
HpackParser hpackParser = HpackParserFactory.createParser(pool, false);
ChannelManagerFactory factory = ChannelManagerFactory.createFactory();
ChannelManager mgr = factory.createMultiThreadedChanMgr("httpClientChanMgr", pool, executor);
InjectionConfig injConfig = new InjectionConfig(hpackParser, new TimeImpl(), config);
return createHttpClient(mgr, injConfig);
}
Aggregations