|
@@ -21,11 +21,11 @@ namespace System.Reactive.Concurrency
|
|
|
return Disposable.Empty;
|
|
|
|
|
|
action(new CancelableScheduler(self, _cts.Token), s, _cts.Token).ContinueWith(
|
|
|
- (t, thisObject) =>
|
|
|
+ static (t, thisObject) =>
|
|
|
{
|
|
|
var @this = (AsyncInvocation<TState>)thisObject;
|
|
|
|
|
|
- t.Exception?.Handle(e => e is OperationCanceledException);
|
|
|
+ t.Exception?.Handle(static e => e is OperationCanceledException);
|
|
|
|
|
|
Disposable.SetSingle(ref @this._run, t.Result);
|
|
|
},
|
|
@@ -218,7 +218,7 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -240,7 +240,7 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -313,7 +313,7 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, dueTime, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, dueTime, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -336,7 +336,7 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, dueTime, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, dueTime, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -409,7 +409,7 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, dueTime, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, dueTime, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -432,37 +432,37 @@ namespace System.Reactive.Concurrency
|
|
|
throw new ArgumentNullException(nameof(action));
|
|
|
}
|
|
|
|
|
|
- return ScheduleAsync_(scheduler, action, dueTime, (self, closureAction, ct) => closureAction(self, ct));
|
|
|
+ return ScheduleAsync_(scheduler, action, dueTime, static (self, closureAction, ct) => closureAction(self, ct));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), dueTime, (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), dueTime, static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, TimeSpan dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), dueTime, (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), dueTime, static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), dueTime, (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), dueTime, static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable ScheduleAsync_<TState>(IScheduler scheduler, TState state, DateTimeOffset dueTime, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
|
|
|
{
|
|
|
- return scheduler.Schedule((state, action), dueTime, (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
+ return scheduler.Schedule((state, action), dueTime, static (self, t) => InvokeAsync(self, t.state, t.action));
|
|
|
}
|
|
|
|
|
|
private static IDisposable InvokeAsync<TState>(IScheduler self, TState s, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
|
|
@@ -472,7 +472,7 @@ namespace System.Reactive.Concurrency
|
|
|
|
|
|
private static IDisposable InvokeAsync<TState>(IScheduler self, TState s, Func<IScheduler, TState, CancellationToken, Task> action)
|
|
|
{
|
|
|
- return InvokeAsync(self, (action, state: s), (self_, t, ct) => t.action(self_, t.state, ct).ContinueWith(_ => Disposable.Empty));
|
|
|
+ return InvokeAsync(self, (action, state: s), static (self_, t, ct) => t.action(self_, t.state, ct).ContinueWith(static _ => Disposable.Empty));
|
|
|
}
|
|
|
|
|
|
private static CancellationToken GetCancellationToken(this IScheduler scheduler)
|