mirror of https://github.com/ppy/osu
Rename and xmldoc `RealmResetEmptySet`
This commit is contained in:
parent
48dacd1c15
commit
d836dba982
|
@ -44,7 +44,7 @@ private void beatmapSetsChanged(IRealmCollection<BeatmapSetInfo> sender, ChangeS
|
|||
{
|
||||
if (changes == null)
|
||||
{
|
||||
if (sender is EmptyRealmSet<BeatmapSetInfo>)
|
||||
if (sender is RealmResetEmptySet<BeatmapSetInfo>)
|
||||
{
|
||||
// Usually we'd reset stuff here, but doing so triggers a silly flow which ends up deadlocking realm.
|
||||
// Additionally, user should not be at song select when realm is blocking all operations in the first place.
|
||||
|
|
|
@ -568,7 +568,7 @@ public IDisposable RegisterForNotifications<T>(Func<Realm, IQueryable<T>> query,
|
|||
lock (notificationsResetMap)
|
||||
{
|
||||
// Store an action which is used when blocking to ensure consumers don't use results of a stale changeset firing.
|
||||
notificationsResetMap.Add(action, () => callback(new EmptyRealmSet<T>(), null));
|
||||
notificationsResetMap.Add(action, () => callback(new RealmResetEmptySet<T>(), null));
|
||||
}
|
||||
|
||||
return RegisterCustomSubscription(action);
|
||||
|
|
|
@ -12,7 +12,13 @@
|
|||
|
||||
namespace osu.Game.Database
|
||||
{
|
||||
public class EmptyRealmSet<T> : IRealmCollection<T>
|
||||
/// <summary>
|
||||
/// This can arrive in <see cref="RealmAccess.RegisterForNotifications{T}"/> callbacks to imply that realm access has been reset.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Usually implies that the original database may return soon and the callback can usually be silently ignored.
|
||||
///</remarks>
|
||||
public class RealmResetEmptySet<T> : IRealmCollection<T>
|
||||
{
|
||||
private IList<T> emptySet => Array.Empty<T>();
|
||||
|
Loading…
Reference in New Issue