using System;
using System.Threading;
using System.Threading.Tasks;
namespace LeanCloud.Storage.Internal {
///
/// IAVObjectCurrentController
controls the single-instance
/// persistence used throughout the code-base. Sample usages are and
/// .
///
/// Type of object being persisted.
public interface IAVObjectCurrentController where T : AVObject {
///
/// Persists current .
///
/// to be persisted.
/// The cancellation token.
Task SetAsync(T obj, CancellationToken cancellationToken);
///
/// Gets the persisted current .
///
/// The cancellation token.
Task GetAsync(CancellationToken cancellationToken);
///
/// Returns a that resolves to true
if current
/// exists.
///
/// The cancellation token.
Task ExistsAsync(CancellationToken cancellationToken);
///
/// Returns true
if the given is the persisted current
/// .
///
/// The object to check.
/// True if obj
is the current persisted .
bool IsCurrent(T obj);
///
/// Nullifies the current from memory.
///
void ClearFromMemory();
///
/// Clears current from disk.
///
void ClearFromDisk();
}
}