Exemplo n.º 1
0
        public HttpResponseMessage Brew(BrewOrder brewOrder, IBaristaRuntimeFactory baristaRuntimeFactory, IBaristaModuleLoader moduleLoader)
        {
            if (brewOrder == null)
            {
                throw new ArgumentNullException(nameof(brewOrder));
            }

            if (baristaRuntimeFactory == null)
            {
                throw new ArgumentNullException(nameof(baristaRuntimeFactory));
            }

            //Brew:
            HttpResponseMessage responseMessage = null;

            BrewMiddleware.Invoke(brewOrder, baristaRuntimeFactory, moduleLoader, (ctx, brewResult) =>
            {
                responseMessage = Serve(ctx, brewResult);
                return(Task.CompletedTask);
            }).GetAwaiter().GetResult();

            return(responseMessage);
        }
Exemplo n.º 2
0
 public IBaristaModuleLoader Tamp(BrewOrder brewOrder, HttpRequest req)
 {
     return(TampMiddleware.Invoke(brewOrder, req));
 }