vlingo-net / xoom-net-actors

Type safe Actor Model toolkit for reactive concurrency and resiliency using C# and other .NET languages.
Mozilla Public License 2.0
39 stars 18 forks source link

Support Task<T> in proxies #58

Closed tjaskula closed 5 years ago

tjaskula commented 5 years ago

Ongoing work on #52 issue. Fixes on ProxyGenerator to come.

tjaskula commented 5 years ago

This allows developers to define custom interfaces that returns a Task<T>. However there is one problem with this approach:

What would be better is, instead of async/awaiting` inside the operation in the actor:

I consider that the current PR addresses the very basic usage of Task<T> in Actors protocols but we should work to support more complete implementations as described above.

Please comment @VaughnVernon @zpbappi and others if you have some ideas.

tjaskula commented 5 years ago

To clarify @VaughnVernon what we have discussed, the proxy is not doing async/await anymore but it is returning the original Task to the client.

VaughnVernon commented 5 years ago

@tjaskula Awesome! 👍

tjaskula commented 5 years ago

@VaughnVernon Another idea would be to have a similar suspension capability as with SuspendExceptFor(...) method for a protocol that contains Task<T> operation. I'll try to spike something around that. WDYT ?