Replies: 1 comment 3 replies
-
Thanks for the feedback. Just for the context, at some point we supported both value task and task. After the API review, the value task won. Here is the PR: Currently, we will be only supporting value task. If there is an overwhelming desire to add task-based overloads we can do it later. In the end it's only minor inconvenience to make the callback async and call task-based APIs. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In V8 the ResiliencePipeline.ExecuteAsync methods now take Func<CancellationToken, ValueTask>().
I personally expect (atleast in my code) that any call which actually requires some kind of retry, let's say because of timeout, actually finishes asynchronously and with that is a Task and not a ValueTask.
I don't want to argue the decision to use ValueTask, I'm just suggesting to add extension methods/overloads or similar with direct support for Task, it just makes the code look a bit cleaner if using Task.
With ValueTask;
vs.
with Task:
Having an extension for Task should also skip one of the asyncmethodbuilder constructs.
In my own codebase i just added the following two extension methods:
Beta Was this translation helpful? Give feedback.
All reactions