Browse Source
Merge pull request #10987 from AvaloniaUI/fixes/dispatcher-invoke-task
Rename InvokeTaskAsync to InvokeAsync to remove breaking behavior change
pull/11002/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
src/Avalonia.Base/Threading/Dispatcher.Invoke.cs
|
|
|
@ -557,10 +557,10 @@ public partial class Dispatcher |
|
|
|
/// <returns>
|
|
|
|
/// An task that completes after the task returned from callback finishes
|
|
|
|
/// </returns>
|
|
|
|
public Task InvokeTaskAsync(Func<Task> callback, DispatcherPriority priority = default) |
|
|
|
public Task InvokeAsync(Func<Task> callback, DispatcherPriority priority = default) |
|
|
|
{ |
|
|
|
_ = callback ?? throw new ArgumentNullException(nameof(callback)); |
|
|
|
return InvokeAsync(callback, priority).GetTask().Unwrap(); |
|
|
|
return InvokeAsync<Task>(callback, priority).GetTask().Unwrap(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -578,10 +578,10 @@ public partial class Dispatcher |
|
|
|
/// <returns>
|
|
|
|
/// An task that completes after the task returned from callback finishes
|
|
|
|
/// </returns>
|
|
|
|
public Task<TResult> InvokeTaskAsync<TResult>(Func<Task<TResult>> action, DispatcherPriority priority = default) |
|
|
|
public Task<TResult> InvokeAsync<TResult>(Func<Task<TResult>> action, DispatcherPriority priority = default) |
|
|
|
{ |
|
|
|
_ = action ?? throw new ArgumentNullException(nameof(action)); |
|
|
|
return InvokeAsync(action, priority).GetTask().Unwrap(); |
|
|
|
return InvokeAsync<Task<TResult>>(action, priority).GetTask().Unwrap(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|