mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add extension methods to add extra safety to realm subscriptions
Also adjusts the naming and documentation to make it (hopefully) easier to understand what this method/process implies.
This commit is contained in:
@ -5,8 +5,8 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Models;
|
||||
using Realms;
|
||||
|
||||
#nullable enable
|
||||
|
||||
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Database
|
||||
|
||||
using (var context = realmFactory.CreateContext())
|
||||
{
|
||||
var subscription = context.All<RealmBeatmap>().SubscribeForNotifications((sender, changes, error) =>
|
||||
var subscription = context.All<RealmBeatmap>().QueryAsyncWithNotifications((sender, changes, error) =>
|
||||
{
|
||||
using (realmFactory.CreateContext())
|
||||
{
|
||||
@ -61,7 +61,7 @@ namespace osu.Game.Tests.Database
|
||||
{
|
||||
}
|
||||
|
||||
subscription.Dispose();
|
||||
subscription?.Dispose();
|
||||
}
|
||||
|
||||
Assert.IsTrue(callbackRan);
|
||||
|
Reference in New Issue
Block a user