This project has moved and is read-only. For the latest updates, please go here.

Why not using Nito.Async.ActionThread ?

Mar 21, 2012 at 9:43 PM

Hi Stephen,

I recently updatet AsyncWcfLib to support awaitable message communication.
It is adapted to an actor based programming model.

Console examples work fine with Nito.Async.ActionThread to provide a synchronization context.
Currently I have a mixture of examples using old style asynchrony with callback lambdas and some newer examples using async-await.

Do you think, it is useful to change all/some AsyncWcfLib examples to Nito.AsyncEx ?

     - Stefan

Mar 22, 2012 at 9:12 PM

Nito.Async.ActionThread will work as long as there are no async void methods. It only works with async Task or async Task<TResult> methods.

Nito.AsyncEx.AsyncContext can be used to establish a context on the current thread, and it works with all kinds of async methods.

I don't think you'll need to support async void methods... the only possible situation I can think of is if you wanted to support one-way messages. I never use those, personally. :) So you could use either ActionThread or AsyncContext/AsyncContextThread.