mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:25:05 +08:00
Expose API scheduling internally
This commit is contained in:
parent
07642546bb
commit
ce2997419a
@ -65,6 +65,8 @@ namespace osu.Game.Online.API
|
||||
|
||||
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
|
||||
|
||||
internal void Schedule(Action action) => base.Schedule(action);
|
||||
|
||||
public void Register(IOnlineComponent component)
|
||||
{
|
||||
Scheduler.Add(delegate
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Online.API
|
||||
return request;
|
||||
}
|
||||
|
||||
private void request_Progress(long current, long total) => Progress?.Invoke(current, total);
|
||||
private void request_Progress(long current, long total) => API.Schedule(() => Progress?.Invoke(current, total));
|
||||
|
||||
protected APIDownloadRequest()
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Online.API
|
||||
if (checkAndProcessFailure())
|
||||
return;
|
||||
|
||||
api.Scheduler.Add(delegate { Success?.Invoke(); });
|
||||
api.Schedule(delegate { Success?.Invoke(); });
|
||||
}
|
||||
|
||||
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
|
||||
@ -108,7 +108,7 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
if (API == null || pendingFailure == null) return cancelled;
|
||||
|
||||
API.Scheduler.Add(pendingFailure);
|
||||
API.Schedule(pendingFailure);
|
||||
pendingFailure = null;
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user