using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Abp.Runtime.Caching
{
///
/// Defines a cache that can be store and get items by keys.
///
public interface ICache : IDisposable
{
///
/// Unique name of the cache.
///
string Name { get; }
///
/// Default sliding expire time of cache items.
/// Default value: 60 minutes (1 hour).
/// Can be changed by configuration.
///
TimeSpan DefaultSlidingExpireTime { get; set; }
///
/// Default absolute expire time of cache items.
/// Default value: null (not used).
///
TimeSpan? DefaultAbsoluteExpireTime { get; set; }
///
/// Gets an item from the cache.
/// This method hides cache provider failures (and logs them),
/// uses the factory method to get the object if cache provider fails.
///
/// Key
/// Factory method to create cache item if not exists
/// Cached item
object Get(string key, Func factory);
///
/// Gets items from the cache.
/// This method hides cache provider failures (and logs them),
/// uses the factory method to get the object if cache provider fails.
///
/// Keys
/// Factory method to create cache item if not exists
/// Cached item
object[] Get(string[] keys, Func factory);
///
/// Gets an item from the cache.
/// This method hides cache provider failures (and logs them),
/// uses the factory method to get the object if cache provider fails.
///
/// Key
/// Factory method to create cache item if not exists
/// Cached item
Task