Search in sources :

Example 1 with TimeImpl

use of org.webpieces.util.time.TimeImpl in project webpieces by deanhiller.

the class Http2ClientFactory method createHttpClient.

public static Http2Client createHttpClient(Http2ClientConfig config, MeterRegistry metrics) {
    Executor executor = Executors.newFixedThreadPool(config.getNumThreads(), new NamedThreadFactory("httpclient"));
    MetricsCreator.monitor(metrics, executor, config.getId());
    TwoPools pool = new TwoPools(config.getId() + ".bufferpool", metrics);
    HpackParser hpackParser = HpackParserFactory.createParser(pool, false);
    ChannelManagerFactory factory = ChannelManagerFactory.createFactory(metrics);
    ChannelManager mgr = factory.createMultiThreadedChanMgr("httpClientChanMgr", pool, config.getBackpressureConfig(), executor);
    InjectionConfig injConfig = new InjectionConfig(hpackParser, new TimeImpl(), config.getHttp2Config());
    return createHttpClient(config.getHttp2Config().getId(), mgr, injConfig);
}
Also used : HpackParser(com.webpieces.hpack.api.HpackParser) Executor(java.util.concurrent.Executor) ChannelManager(org.webpieces.nio.api.ChannelManager) NamedThreadFactory(org.webpieces.util.threading.NamedThreadFactory) TwoPools(org.webpieces.data.api.TwoPools) InjectionConfig(com.webpieces.http2engine.api.client.InjectionConfig) ChannelManagerFactory(org.webpieces.nio.api.ChannelManagerFactory) TimeImpl(org.webpieces.util.time.TimeImpl)

Example 2 with TimeImpl

use of org.webpieces.util.time.TimeImpl in project webpieces by deanhiller.

the class HttpFrontendFactory method createFrontEnd.

/**
 * @param id Use for logging and also file recording names
 * use the SessionExecutorImpl found in webpieces
 * @param metrics
 *
 * @return
 */
public static HttpFrontendManager createFrontEnd(String id, ScheduledExecutorService timer, BufferPool pool, FrontendMgrConfig config, MeterRegistry metrics) {
    Executor executor = Executors.newFixedThreadPool(config.getThreadPoolSize(), new NamedThreadFactory(id));
    MetricsCreator.monitor(metrics, executor, id);
    ChannelManagerFactory factory = ChannelManagerFactory.createFactory(metrics);
    ChannelManager chanMgr = factory.createMultiThreadedChanMgr(id, pool, config.getBackpressureConfig(), executor);
    AsyncServerManager svrMgr = AsyncServerMgrFactory.createAsyncServer(chanMgr, metrics);
    HttpParser httpParser = HttpParserFactory.createParser(id, metrics, pool);
    HpackParser http2Parser = HpackParserFactory.createParser(pool, true);
    InjectionConfig injConfig = new InjectionConfig(http2Parser, new TimeImpl(), config.getHttp2Config());
    Http2ServerEngineFactory svrEngineFactory = new Http2ServerEngineFactory(injConfig);
    return new FrontEndServerManagerImpl(svrMgr, timer, svrEngineFactory, httpParser);
}
Also used : HpackParser(com.webpieces.hpack.api.HpackParser) Executor(java.util.concurrent.Executor) ChannelManager(org.webpieces.nio.api.ChannelManager) NamedThreadFactory(org.webpieces.util.threading.NamedThreadFactory) InjectionConfig(com.webpieces.http2engine.api.client.InjectionConfig) HttpParser(org.webpieces.httpparser.api.HttpParser) AsyncServerManager(org.webpieces.asyncserver.api.AsyncServerManager) Http2ServerEngineFactory(com.webpieces.http2engine.api.server.Http2ServerEngineFactory) ChannelManagerFactory(org.webpieces.nio.api.ChannelManagerFactory) TimeImpl(org.webpieces.util.time.TimeImpl) FrontEndServerManagerImpl(org.webpieces.frontend2.impl.FrontEndServerManagerImpl)

Example 3 with TimeImpl

use of org.webpieces.util.time.TimeImpl in project webpieces by deanhiller.

the class HttpFrontendFactory method createFrontEnd.

public static HttpFrontendManager createFrontEnd(AsyncServerManager svrMgr, BufferPool pool, Http2Config http2Config, MeterRegistry metrics) {
    ScheduledExecutorService timer = Executors.newSingleThreadScheduledExecutor();
    HttpParser httpParser = HttpParserFactory.createParser(svrMgr.getName(), metrics, pool);
    HpackParser http2Parser = HpackParserFactory.createParser(pool, true);
    InjectionConfig injConfig = new InjectionConfig(http2Parser, new TimeImpl(), http2Config);
    Http2ServerEngineFactory svrEngineFactory = new Http2ServerEngineFactory(injConfig);
    return new FrontEndServerManagerImpl(svrMgr, timer, svrEngineFactory, httpParser);
}
Also used : HpackParser(com.webpieces.hpack.api.HpackParser) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) InjectionConfig(com.webpieces.http2engine.api.client.InjectionConfig) HttpParser(org.webpieces.httpparser.api.HttpParser) Http2ServerEngineFactory(com.webpieces.http2engine.api.server.Http2ServerEngineFactory) TimeImpl(org.webpieces.util.time.TimeImpl) FrontEndServerManagerImpl(org.webpieces.frontend2.impl.FrontEndServerManagerImpl)

Example 4 with TimeImpl

use of org.webpieces.util.time.TimeImpl in project webpieces by deanhiller.

the class Http2ClientFactory method createHttpClient.

public static Http2Client createHttpClient(Http2Config config, ChannelManager mgr, BufferPool pool) {
    HpackParser hpackParser = HpackParserFactory.createParser(pool, false);
    InjectionConfig injConfig = new InjectionConfig(hpackParser, new TimeImpl(), config);
    return createHttpClient(config.getId(), mgr, injConfig);
}
Also used : HpackParser(com.webpieces.hpack.api.HpackParser) InjectionConfig(com.webpieces.http2engine.api.client.InjectionConfig) TimeImpl(org.webpieces.util.time.TimeImpl)

Aggregations

HpackParser (com.webpieces.hpack.api.HpackParser)4 InjectionConfig (com.webpieces.http2engine.api.client.InjectionConfig)4 TimeImpl (org.webpieces.util.time.TimeImpl)4 Http2ServerEngineFactory (com.webpieces.http2engine.api.server.Http2ServerEngineFactory)2 Executor (java.util.concurrent.Executor)2 FrontEndServerManagerImpl (org.webpieces.frontend2.impl.FrontEndServerManagerImpl)2 HttpParser (org.webpieces.httpparser.api.HttpParser)2 ChannelManager (org.webpieces.nio.api.ChannelManager)2 ChannelManagerFactory (org.webpieces.nio.api.ChannelManagerFactory)2 NamedThreadFactory (org.webpieces.util.threading.NamedThreadFactory)2 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 AsyncServerManager (org.webpieces.asyncserver.api.AsyncServerManager)1 TwoPools (org.webpieces.data.api.TwoPools)1