use of org.webpieces.nio.api.ChannelManager in project webpieces by deanhiller.
the class IntegGoogleHttps method createHttpClient.
public static HttpClient createHttpClient() {
BufferPool pool2 = new BufferCreationPool();
Executor executor2 = Executors.newFixedThreadPool(10, new NamedThreadFactory("clientThread"));
ChannelManagerFactory factory = ChannelManagerFactory.createFactory();
ChannelManager mgr = factory.createMultiThreadedChanMgr("client", pool2, executor2);
HttpParser parser = HttpParserFactory.createParser(pool2);
HttpClient client = HttpClientFactory.createHttpClient(mgr, parser);
return client;
}
use of org.webpieces.nio.api.ChannelManager 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.ChannelManager 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