/** <inheritDoc /> */ public Task <IDictionary <TK, ICacheEntryProcessorResult <TRes> > > InvokeAllAsync <TArg, TRes>(IEnumerable <TK> keys, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { AsyncInstance.InvokeAll(keys, processor, arg); return(AsyncInstance.GetTask(CacheOp.InvokeAll, reader => ReadInvokeAllResults <TRes>(reader.Stream))); }
/** <inheritDoc /> */ public Task <CacheResult <TV> > TryGetAsync(TK key) { IgniteArgumentCheck.NotNull(key, "key"); AsyncInstance.Get(key); return(AsyncInstance.GetTask(CacheOp.Get, GetCacheResult)); }
/** <inheritDoc /> */ public Task <TV> GetAsync(TK key) { AsyncInstance.Get(key); return(AsyncInstance.GetTask(CacheOp.Get, reader => { if (reader != null) { return reader.ReadObject <TV>(); } throw GetKeyNotFoundException(); })); }
/** <inheritDoc /> */ public Task <TRes> InvokeAsync <TArg, TRes>(TK key, ICacheEntryProcessor <TK, TV, TArg, TRes> processor, TArg arg) { AsyncInstance.Invoke(key, processor, arg); return(AsyncInstance.GetTask(CacheOp.Invoke, r => { if (r == null) { return default(TRes); } var hasError = r.ReadBoolean(); if (hasError) { throw ReadException(r.Stream); } return r.ReadObject <TRes>(); })); }
/** <inheritDoc /> */ public Task ClearAsync(TK key) { AsyncInstance.Clear(key); return(AsyncInstance.GetTask(CacheOp.Clear)); }
/** <inheritDoc /> */ public Task ClearAsync() { AsyncInstance.Clear(); return(AsyncInstance.GetTask()); }
/** <inheritDoc /> */ public Task PutAllAsync(IDictionary <TK, TV> vals) { AsyncInstance.PutAll(vals); return(AsyncInstance.GetTask(CacheOp.PutAll)); }
/** <inheritDoc /> */ public Task <bool> ContainsKeyAsync(TK key) { AsyncInstance.ContainsKey(key); return(AsyncInstance.GetTask <bool>(CacheOp.ContainsKey)); }
/** <inheritDoc /> */ public Task RemoveAllAsync() { AsyncInstance.RemoveAll(); return(AsyncInstance.GetTask()); }
/** <inheritDoc /> */ public Task <bool> RemoveAsync(TK key, TV val) { AsyncInstance.Remove(key, val); return(AsyncInstance.GetTask <bool>(CacheOp.RemoveBool)); }
/** <inheritDoc /> */ public Task <CacheResult <TV> > GetAndRemoveAsync(TK key) { AsyncInstance.GetAndRemove(key); return(AsyncInstance.GetTask(CacheOp.GetAndRemove, GetCacheResult)); }
/** <inheritDoc /> */ public Task <CacheResult <TV> > GetAndReplaceAsync(TK key, TV val) { AsyncInstance.GetAndReplace(key, val); return(AsyncInstance.GetTask(CacheOp.GetAndReplace, GetCacheResult)); }
/** <inheritDoc /> */ public Task PutAsync(TK key, TV val) { AsyncInstance.Put(key, val); return(AsyncInstance.GetTask(CacheOp.Put)); }
/** <inheritDoc /> */ public Task <IDictionary <TK, TV> > GetAllAsync(IEnumerable <TK> keys) { AsyncInstance.GetAll(keys); return(AsyncInstance.GetTask(CacheOp.GetAll, r => r == null ? null : ReadGetAllDictionary(r))); }
/** <inheritDoc /> */ public Task <bool> ContainsKeysAsync(IEnumerable <TK> keys) { AsyncInstance.ContainsKeys(keys); return(AsyncInstance.GetTask <bool>(CacheOp.ContainsKeys)); }
/** <inheritDoc /> */ public Task ClearAllAsync(IEnumerable <TK> keys) { AsyncInstance.ClearAll(keys); return(AsyncInstance.GetTask(CacheOp.ClearAll)); }
/** <inheritDoc /> */ public Task <bool> RemoveAsync(TK key) { AsyncInstance.Remove(key); return(AsyncInstance.GetTask <bool>(CacheOp.RemoveObj)); }
/** <inheritDoc /> */ public Task <bool> PutIfAbsentAsync(TK key, TV val) { AsyncInstance.PutIfAbsent(key, val); return(AsyncInstance.GetTask <bool>(CacheOp.PutIfAbsent)); }
/** <inheritDoc /> */ public Task RemoveAllAsync(IEnumerable <TK> keys) { AsyncInstance.RemoveAll(keys); return(AsyncInstance.GetTask(CacheOp.RemoveAll)); }
/** <inheritDoc /> */ public Task <CacheResult <TV> > GetAndPutIfAbsentAsync(TK key, TV val) { AsyncInstance.GetAndPutIfAbsent(key, val); return(AsyncInstance.GetTask(CacheOp.GetAndPutIfAbsent, GetCacheResult)); }
/** <inheritDoc /> */ public Task <int> GetSizeAsync(params CachePeekMode[] modes) { AsyncInstance.GetSize(modes); return(AsyncInstance.GetTask <int>()); }
/** <inheritDoc /> */ public Task <bool> ReplaceAsync(TK key, TV val) { AsyncInstance.Replace(key, val); return(AsyncInstance.GetTask <bool>(CacheOp.Replace2)); }
/** <inheritDoc /> */ public Task <bool> ReplaceAsync(TK key, TV oldVal, TV newVal) { AsyncInstance.Replace(key, oldVal, newVal); return(AsyncInstance.GetTask <bool>(CacheOp.Replace3)); }
/** <inheritDoc /> */ public Task LocalLoadCacheAsync(ICacheEntryFilter <TK, TV> p, params object[] args) { AsyncInstance.LocalLoadCache(p, args); return(AsyncInstance.GetTask(CacheOp.LocLoadCache)); }