2021-01-07 13:07:36 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using Realms;
|
|
|
|
|
|
|
|
namespace osu.Game.Database
|
|
|
|
{
|
|
|
|
public interface IRealmFactory
|
|
|
|
{
|
2021-01-13 16:34:44 +08:00
|
|
|
/// <summary>
|
|
|
|
/// The main realm context, bound to the update thread.
|
|
|
|
/// </summary>
|
|
|
|
public Realm Context { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Get a fresh context for read usage.
|
|
|
|
/// </summary>
|
|
|
|
Realm GetForRead();
|
2021-01-07 13:07:36 +08:00
|
|
|
|
|
|
|
/// <summary>
|
2021-01-13 16:34:44 +08:00
|
|
|
/// Request a context for write usage.
|
2021-01-07 13:07:36 +08:00
|
|
|
/// This method may block if a write is already active on a different thread.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A usage containing a usable context.</returns>
|
|
|
|
RealmWriteUsage GetForWrite();
|
|
|
|
}
|
|
|
|
}
|