예제 #1
0
        public void HandleRequest(IHttpContext context)
        {
            IRequest      request   = context.Request;
            IResponse     response  = context.Response;
            ResponderList responder = new ResponderList(_conf, _responders);

            try
            {
                if (!responder.Respond(context))
                {
                    NotResponded?.Invoke(this, request);
                    ResponderNotFoundHandler(context);
                }
                else
                {
                    TriggerResponding(response, responder.HandlingResponder);
                    Respond(response);
                    TriggerResponded(request, responder.HandlingResponder);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler(context, ex);
            }
        }
예제 #2
0
 protected internal void OnNotResponded(IHttpContext context)
 {
     Task.Run(() => NotResponded?.Invoke(this, context));
 }