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

            AsyncInstance.Get(key);

            return(AsyncInstance.GetTask(CacheOp.Get, GetCacheResult));
        }
Exemplo 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();
            }));
        }