@SuppressWarnings("rawtypes")
    @Override
    public void run() throws SuspendExecution {
      try {
        response = request.handler().process(request);
      } catch (Throwable e) {
        response = buildUnhandledExceptionResponse(request, e);
        log.error("unhandled exception in coroutine", e);
      }

      if (Coroutine.getActiveCoroutine().getResumeCounter() != 1) {
        request.handler().completeAsyncResponse(request, response);
      }
    }
  public static NginxResponse handleRequest(final NginxRequest req) {
    try {

      if (coroutineEnabled) {
        CoroutineRunner coroutineRunner = new CoroutineRunner(req);
        Coroutine coroutine = new Coroutine(coroutineRunner);
        coroutine.resume();
        if (coroutine.getState() == Coroutine.State.FINISHED) {
          return coroutineRunner.response;
        } else {
          return new NginxJavaResponse(req, Constants.ASYNC_TAG);
        }
      } else {
        return req.handler().process(req);
      }
    } catch (Throwable e) {
      log.error("server unhandled exception!", e);
      return buildUnhandledExceptionResponse(req, e);
    }
  }