public static Setup main() { return DEFAULT.get().main; }
protected HttpClient getOrCreateClient() { return client.get(); }
public static synchronized Setup setup() { return setup.get(); }
public void execute(Operation<Connection> operation) { workers.get().execute(operation); }
public Map<String, String> argsAsMap() { RapidoidEnv.touch(); return argsAsMap.get(); }
public Future<HttpResp> executeRequest(HttpReq req, Callback<HttpResp> callback) { return HttpClientUtil.request(req, client.get(), callback, false); }
public Opt<ThreadPoolExecutor> executor() { return Opt.maybe(isActive() ? executor.get().executor() : null); }
public Opt<ScheduledThreadPoolExecutor> scheduler() { return Opt.maybe(isActive() ? scheduler.get().scheduler() : null); }
private void execHandlerJob(final Channel channel, final boolean isKeepAlive, final MediaType contentType, final Req req) { With.tag(CTX_TAG_HANDLER).exchange(req).run(() -> { try { req.response() .view(options.view()) .contentType(options.contentType()) .mvc(options.mvc()); handleWithWrappers(channel, isKeepAlive, contentType, req, wrappers.get()); } catch (Throwable e) { handleError(req, e); } }); }
static Setup on() { return DEFAULT.get().on; }
protected HttpClient getOrCreateClient() { return client.get(); }
public FastHttp http() { return lazyHttp.get(); }
static Setup admin() { return DEFAULT.get().admin; }
public void execute(Operation<Connection> operation) { workers.get().execute(operation); }
@Override public void run() { try { req.response() .view(options.view()) .contentType(options.contentType()) .mvc(options.mvc()); handleWithWrappers(channel, isKeepAlive, contentType, req, wrappers.get()); } catch (Throwable e) { handleError(req, e); } }