mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Expose API scheduling internally
This commit is contained in:
@ -65,6 +65,8 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
|
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
|
||||||
|
|
||||||
|
internal void Schedule(Action action) => base.Schedule(action);
|
||||||
|
|
||||||
public void Register(IOnlineComponent component)
|
public void Register(IOnlineComponent component)
|
||||||
{
|
{
|
||||||
Scheduler.Add(delegate
|
Scheduler.Add(delegate
|
||||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Online.API
|
|||||||
return request;
|
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()
|
protected APIDownloadRequest()
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ namespace osu.Game.Online.API
|
|||||||
if (checkAndProcessFailure())
|
if (checkAndProcessFailure())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
api.Scheduler.Add(delegate { Success?.Invoke(); });
|
api.Schedule(delegate { Success?.Invoke(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
|
public void Cancel() => Fail(new OperationCanceledException(@"Request cancelled"));
|
||||||
@ -108,7 +108,7 @@ namespace osu.Game.Online.API
|
|||||||
{
|
{
|
||||||
if (API == null || pendingFailure == null) return cancelled;
|
if (API == null || pendingFailure == null) return cancelled;
|
||||||
|
|
||||||
API.Scheduler.Add(pendingFailure);
|
API.Schedule(pendingFailure);
|
||||||
pendingFailure = null;
|
pendingFailure = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user