Ejemplo n.º 1
0
        public virtual Task ClearStateAsync(string grainType, GrainReference grainReference, IGrainState grainState)
        {
            logger.Info(0, "ClearStateAsync for {0} {1}", grainType, grainReference);
            Interlocked.Increment(ref deleteCount);
            var keys = MakeGrainStateKeys(grainType, grainReference);

            lock (StateStore)
            {
                StateStore.DeleteRow(keys, grainState.ETag);
                LastId    = GetId(grainReference);
                LastState = null;
            }
            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public virtual Task ClearStateAsync(string grainType, GrainReference grainReference, GrainState grainState)
        {
            Log.Info(0, "ClearStateAsync for {0} {1}", grainType, grainReference);
            Interlocked.Increment(ref deleteCount);
            var keys = MakeGrainStateKeys(grainType, grainReference);

            lock (StateStore)
            {
                StateStore.DeleteRow(keys, grainState.Etag);

                LastId    = GetId(grainReference);
                LastState = StateStore.ReadRow(keys);
            }
            return(TaskDone.Done);
        }
Ejemplo n.º 3
0
        public virtual Task ClearStateAsync <T>(string grainType, GrainReference grainReference, IGrainState <T> grainState)
        {
            logger.LogInformation("ClearStateAsync for {GrainType} {GrainId}", grainType, grainReference?.GrainId);
            Interlocked.Increment(ref deleteCount);
            var keys = MakeGrainStateKeys(grainType, grainReference);

            lock (StateStore)
            {
                StateStore.DeleteRow(keys, grainState.ETag);
                LastId    = GetId(grainReference);
                LastState = null;
            }
            grainState.RecordExists = false;
            return(Task.CompletedTask);
        }