using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Database.Implementations.Locking;
///
/// Defines a jellyfin locking behavior that can be configured.
///
public interface IEntityFrameworkCoreLockingBehavior
{
///
/// Provides access to the builder to setup any connection related locking behavior.
///
/// The options builder.
void Initialise(DbContextOptionsBuilder optionsBuilder);
///
/// Will be invoked when changes should be saved in the current locking behavior.
///
/// The database context invoking the action.
/// Callback for performing the actual save changes.
void OnSaveChanges(JellyfinDbContext context, Action saveChanges);
///
/// Will be invoked when changes should be saved in the current locking behavior.
///
/// The database context invoking the action.
/// Callback for performing the actual save changes.
/// A representing the asynchronous operation.
Task OnSaveChangesAsync(JellyfinDbContext context, Func saveChanges);
}