Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ValueTask OnReceiveAsync(object message) for UntypedActor #3888

iron9light opened this issue Aug 21, 2019 · 0 comments


Copy link

commented Aug 21, 2019

Something like:

    public abstract class AsyncUntypedActor : UntypedActor
        protected override void OnReceive(object message)
            var valueTask = OnReceiveAsync(message);
            if (!valueTask.IsCompletedSuccessfully)
                RunTask(async () => await valueTask);

        protected abstract ValueTask OnReceiveAsync(object message);

Then the derived class can use async/await and switch pattern match to implement OnReceiveAsync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.