Esempio n. 1
0
        /** <inheritDoc /> */
        public Task <CacheResult <TV> > TryGetAsync(TK key)
        {
            IgniteArgumentCheck.NotNull(key, "key");

            AsyncInstance.Get(key);

            return(AsyncInstance.GetTask(CacheOp.Get, GetCacheResult));
        }
Esempio n. 2
0
        /** <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();
            }));
        }