Rename and xmldoc `RealmResetEmptySet`

This commit is contained in:
Dean Herbert 2024-10-09 14:18:34 +09:00
parent 48dacd1c15
commit d836dba982
No known key found for this signature in database
3 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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>();