internal ActorStateManager(ActorBase actor, IActorStateProvider actorStateProvider)
 {
     this.actor              = actor;
     this.stateProvider      = actorStateProvider;
     this.stateChangeTracker = new Dictionary <string, StateMetadata>();
 }
 internal IActorStateManager CreateStateManager(ActorBase actor)
 {
     return(this.stateManagerFactory.Invoke(actor, this.StateProvider));
 }
 private ActorUseScope(ActorBase actor, bool timerUse)
 {
     this.Actor    = actor;
     this.timerUse = timerUse;
 }
 private Task OnPostDeactivateAsync(ActorBase actor)
 {
     return(TaskDone.Done);
 }
 private static IActorStateManager DefaultActorStateManagerFactory(ActorBase actorBase, IActorStateProvider actorStateProvider)
 {
     return(new ActorStateManager(actorBase, actorStateProvider));
 }
 private static Task SaveStateAsync(ActorBase actor)
 {
     return(actor.SaveStateAsyncInternal());
 }
 internal async Task OnPreInvokeAsync(ActorBase actor, ActorMethodContext actorMethodContext)
 {
     this.ThrowIfClosed();
     await actor.OnPreActorMethodAsyncInternal(actorMethodContext);
 }
 private static Task ResetStateAsync(ActorBase actor)
 {
     return(actor.ResetStateAsyncInternal());
 }
        internal Task RemoveActorStateAsync(ActorBase actor)
        {
            ActorTrace.Source.WriteInfoWithId(TraceType, this.traceId, "Deleting state for Actor {0}, as delete actor call was made for it.", actor.Id);

            return(this.StateProvider.RemoveActorAsync(actor.Id));
        }
        internal async Task OnPostActivateAsync(ActorBase actor)
        {
            await this.StateProvider.ActorActivatedAsync(actor.Id);

            await actor.OnPostActivateAsync();
        }
 internal Task OnPreActivateAsync(ActorBase actor)
 {
     return(ResetStateAsync(actor));
 }
 private static bool ShouldInitialize(ActorBase actor)
 {
     return(actor.IsInitialized != true);
 }