Async AutoSubscriber #68

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@danbarua

Hi Mike,
I tried jonnii's suggested expression tree trick here https://gist.github.com/jonnii/4714812 but we don't know the type TMessage of Func < TMessage , Task > at compile time, so I couldn't get that to work.

Also the unit test is very basic as I haven't figured out how to inspect the type arguments on the onMessage parameter.

This definitely needs some improvement before merging in.

-Dan

@danbarua

Also, is there a better way of doing this?

var onMessage = new Func<object, Task>(e => Task.Factory.StartNew(() => dispatchDelegate.DynamicInvoke(e)));
busSubscribeMethod.Invoke(bus, new object[] { subscriptionId,onMessage});
@danbarua

Thanks Jonnii, I'll try to have a look at that later.

@danbarua

I'm going to close this out, if you need this functionality it's easier to just copy and paste into your project and adapt to your own needs.

@danbarua danbarua closed this May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment