// WingsEmu // // Developed by NosWings Team using System; using System.Collections.Generic; using System.Threading.Tasks; namespace PhoenixLib.DAL { public interface IKeyValueAsyncStorage where TKey : notnull { /// /// Gets all the objects stored within the cache /// /// Task> GetAllAsync(); /// /// Clears cache /// /// Task ClearAllAsync(); /// /// Gets all the objects that are contained in the given id enumerable /// /// /// Task> GetByIdsAsync(IEnumerable ids); /// /// Gets the object with the given key from the cache /// /// /// Task GetByIdAsync(TKey id); /// /// Registers the object that are contained /// /// /// /// /// Task RegisterAsync(TKey id, TObject obj, TimeSpan? lifeTime = null); /// /// Asynchronously registers all the objects given as parameter assuming that these objects contains a key /// /// /// Task RegisterAsync(IEnumerable<(TKey, TObject)> objs, TimeSpan? lifeTime = null); /// /// Asynchronously removes the object and returns it /// /// Task RemoveAsync(TKey id); /// /// Asynchronously removes the objects with the given keys /// /// /// Task> RemoveAsync(IEnumerable ids); } }