Permalink
Browse files

Updating Owin.cs declarations based on current conversations

BodyDelegate write && flush re-joined into single write

IAppBuilder gains Context dictionary

IAppBuilder gains ability to add new adapters for previously
unknown app delegate signatures

Request and response header values become string[] instead
of IEnumerable<string>
  • Loading branch information...
1 parent 4a88703 commit 250304382100a0c0501fd96df6870709f36f3f02 @loudej committed Jun 4, 2012
Showing with 6 additions and 16 deletions.
  1. +6 −16 src/main/Owin/Owin.cs
View
@@ -5,40 +5,30 @@
namespace Owin
{
- public static class OwinConstants
- {
- public const string Version = "owin.Version";
- public const string RequestScheme = "owin.RequestScheme";
- public const string RequestMethod = "owin.RequestMethod";
- public const string RequestPathBase = "owin.RequestPathBase";
- public const string RequestPath = "owin.RequestPath";
- public const string RequestQueryString = "owin.RequestQueryString";
- public const string RequestHeaders = "owin.RequestHeaders";
- public const string RequestBody = "owin.RequestBody";
- }
-
public delegate void AppDelegate(
IDictionary<string, object> env,
ResultDelegate result,
Action<Exception> fault);
public delegate void ResultDelegate(
string status,
- IDictionary<string, IEnumerable<string>> headers,
+ IDictionary<string, string[]> headers,
BodyDelegate body);
public delegate void BodyDelegate(
- Func<ArraySegment<byte>, bool> write,
- Func<Action, bool> flush,
+ Func<ArraySegment<byte>, Action, bool> write,
Action<Exception> end,
CancellationToken cancellationToken);
- public delegate Task<Tuple<string /* status */, IDictionary<String, IEnumerable<string>> /* headers */, BodyDelegate /* body */>>
+ public delegate Task<Tuple<string /* status */, IDictionary<String, string[]> /* headers */, BodyDelegate /* body */>>
AppTaskDelegate(IDictionary<string, object> env);
public interface IAppBuilder
{
IAppBuilder Use<TApp>(Func<TApp, TApp> middleware);
TApp Build<TApp>(Action<IAppBuilder> fork);
+
+ IAppBuilder AddAdapters<TApp1, TApp2>(Func<TApp1, TApp2> adapter1, Func<TApp2, TApp1> adapter2);
+ IDictionary<string, object> Context { get; }
}
}

0 comments on commit 2503043

Please sign in to comment.