Refine RealmContext implementation API

This commit is contained in:
Dean Herbert
2021-09-30 23:42:40 +09:00
parent b8b61a196f
commit 9fa901f6aa
9 changed files with 174 additions and 254 deletions

View File

@ -9,20 +9,12 @@ namespace osu.Game.Database
{
/// <summary>
/// The main realm context, bound to the update thread.
/// If querying from a non-update thread is needed, use <see cref="GetForRead"/> or <see cref="GetForWrite"/> to receive a context instead.
/// </summary>
Realm Context { get; }
/// <summary>
/// Get a fresh context for read usage.
/// Create a new realm context for use on an arbitrary thread.
/// </summary>
RealmContextFactory.RealmUsage GetForRead();
/// <summary>
/// Request a context for write usage.
/// This method may block if a write is already active on a different thread.
/// </summary>
/// <returns>A usage containing a usable context.</returns>
RealmContextFactory.RealmWriteUsage GetForWrite();
Realm CreateContext();
}
}