Async AutoSubscriber #68

wants to merge 2 commits into


None yet

2 participants


Hi Mike,
I tried jonnii's suggested expression tree trick here 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.



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});

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


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