Beispiel #1
0
        public async Task UpsertStateAsync(GrainIdentity grainIdentity, IDictionary <string, object> state)
        {
            Guard.NotNull(grainIdentity, "grainIdentity");
            Guard.NotNull(state, "state");

            ShardBatcher shardBatcher = LookupShardBatcher(grainIdentity);

            // We don't want to measure elapsed in case of exception
            var sw = Stopwatch.StartNew();
            await shardBatcher.UpsertStateAsync(grainIdentity, state);

            Logger.Info("UpsertStateAsync for {1} elapsed {0}", sw.Elapsed, grainIdentity.GrainType);
        }
Beispiel #2
0
        public async Task <IDictionary <string, object> > ReadStateAsync(GrainIdentity grainIdentity)
        {
            Guard.NotNull(grainIdentity, "grainIdentity");

            ShardBatcher shardBatcher = LookupShardBatcher(grainIdentity);

            // We don't want to measure elapsed in case of exception
            var sw    = Stopwatch.StartNew();
            var state = await shardBatcher.ReadStateAsync(grainIdentity);

            Logger.Info("ReadStateAsync for {1} elapsed {0}", sw.Elapsed, grainIdentity.GrainType);
            return(state);
        }