public static IServer CreateGate(this IServerFactory factory, AppFunc app, IScheduler scheduler, IDictionary <string, object> context) { if (context == null) { context = new Dictionary <string, object>(); } if (!context.ContainsKey("kayak.Scheduler")) { context["kayak.Scheduler"] = scheduler; } return(factory.CreateHttp(new GateRequestDelegate(app, context), scheduler)); }