Proposed BuildFunc Signature

116 views
Skip to first unread message

Ryan Riley

unread,
May 24, 2014, 11:27:32 AM5/24/14
to net-http-a...@googlegroups.com
Where might I find the proposed BuildFunc signature? I can't seem to find it now.

Mark Rendle

unread,
May 24, 2014, 1:18:56 PM5/24/14
to net-http-a...@googlegroups.com
Func<AppFunc, AppFunc>


On Saturday, 24 May 2014, Ryan Riley <ryan....@panesofglass.org> wrote:
Where might I find the proposed BuildFunc signature? I can't seem to find it now.

--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Mark Rendle
Founder, Zudio

Damian Hickey

unread,
May 25, 2014, 8:13:11 AM5/25/14
to net-http-a...@googlegroups.com
Thought that was MidFunc?


BuildFunc = Action<Func<IDictionary<string,object>, MidFunc>>


On Saturday, 24 May 2014 19:18:56 UTC+2, Mark Rendle wrote:
Func<AppFunc, AppFunc>

On Saturday, 24 May 2014, Ryan Riley <ryan....@panesofglass.org> wrote:
Where might I find the proposed BuildFunc signature? I can't seem to find it now.

--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstractions+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mark Rendle

unread,
May 25, 2014, 3:05:21 PM5/25/14
to net-http-a...@googlegroups.com
Yes, you're right of course. I was having a brain fart.

M
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Kristian Hellang

unread,
May 26, 2014, 6:36:33 AM5/26/14
to net-http-a...@googlegroups.com
What is the dictionary in the BuildFunc? Is that the same as IAppBuilder.Properties?

Mark Rendle

unread,
May 26, 2014, 7:13:21 AM5/26/14
to net-http-a...@googlegroups.com
Yes. It's for application- rather than request-level info, where the Server can put capability info, for example.


On Monday, 26 May 2014, Kristian Hellang <kris...@hellang.com> wrote:
What is the dictionary in the BuildFunc? Is that the same as IAppBuilder.Properties?

--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Damian Hickey

unread,
May 26, 2014, 8:15:12 AM5/26/14
to net-http-a...@googlegroups.com
For example see 6. CommonKeys, Startup column. http://owin.org/spec/CommonKeys.html


On Monday, 26 May 2014 13:13:21 UTC+2, Mark Rendle wrote:
Yes. It's for application- rather than request-level info, where the Server can put capability info, for example.

On Monday, 26 May 2014, Kristian Hellang <kris...@hellang.com> wrote:
What is the dictionary in the BuildFunc? Is that the same as IAppBuilder.Properties?

--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstractions+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sebastien Lambla

unread,
May 27, 2014, 9:40:17 AM5/27/14
to net-http-a...@googlegroups.com
Hmmm. I think I’m responsiuble for those names so…

AppFunc we know
MidFunc is Func<AppFunc,AppFunc>
BuildFunc would be, if we want to have feature parity with IAppBuilder.Properties, which I think would be the best option to get the blue badges to drop their IBuilder alltogether and standardize on what we come up with:

static void MyApp(this Func<IDictionary<string,object>, MidFunc> builder) {
return properties => new MyMiddleware(properties).Invoke;
}

Any ideas?
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.

Sebastien Lambla

unread,
May 27, 2014, 9:45:18 AM5/27/14
to net-http-a...@googlegroups.com
Or

static void MyApp(this Action<Func<IDictionary<string,object>,MidFunc> builder) {
builder(properties=>new MyMiddleware(propertioes).Invoke)
}

this looks not as nice but has teh advantage of making the builder a little bit more like a thing that is tangible for middleware authors.

What do we think?

Damian Hickey

unread,
May 27, 2014, 11:15:16 AM5/27/14
to net-http-a...@googlegroups.com
Any benefit to returning the builder for chaining? (Just thinking out loud)

static Action<Func<IDictionary<string,object>,MidFunc> MyApp(this Action<Func<IDictionary<string,object>,MidFunc> builder) {
      builder(properties=>new MyMiddleware(propertioes).Invoke);
      return builder;

Damian Hickey

unread,
May 27, 2014, 12:10:35 PM5/27/14
to net-http-a...@googlegroups.com
I've been playing around with BuildFunc extensions in Owin.Limits (yes, considering a rename), to see what the experience would be. This is what one would see, intellisense wise:

Can't say I 'like' it. 

By all means, please review the code. :)


On Tuesday, 27 May 2014 15:45:18 UTC+2, SerialSeb wrote:
Reply all
Reply to author
Forward
0 new messages