예제 #1
0
 public override void Participate(IGrainLifecycle lifecycle)
 {
     base.Participate(lifecycle);
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.Activate, (cancel) =>
     {
         return(Task.CompletedTask);
     });
 }
예제 #2
0
 public virtual void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe <LogConsistentGrain <TView> >(GrainLifecycleStage.SetupState, OnSetupState, OnDeactivateState);
     if (this is ILogConsistencyProtocolParticipant)
     {
         lifecycle.Subscribe <LogConsistentGrain <TView> >(GrainLifecycleStage.Activate - 1, PreActivate);
         lifecycle.Subscribe <LogConsistentGrain <TView> >(GrainLifecycleStage.Activate + 1, PostActivate);
     }
 }
예제 #3
0
 public override void Participate(IGrainLifecycle lifecycle)
 {
     base.Participate(lifecycle);
     lifecycle.Subscribe(GrainLifecycleStage.SetupState, OnSetupState);
     if (this is ILogConsistencyProtocolParticipant)
     {
         lifecycle.Subscribe(GrainLifecycleStage.Activate - 1, PreActivate);
         lifecycle.Subscribe(GrainLifecycleStage.Activate + 1, PostActivate);
     }
 }
예제 #4
0
 public override void Participate(IGrainLifecycle lifecycle)
 {
     base.Participate(lifecycle);
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.SetupState, token =>
     {
         Console.WriteLine("Setup State");
         return(Task.CompletedTask);
     });
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.Activate, token =>
     {
         Console.WriteLine("Activate State");
         return(Task.CompletedTask);
     });
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.First, token =>
     {
         Console.WriteLine("First State");
         return(Task.CompletedTask);
     });
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.Last, token =>
     {
         Console.WriteLine("Last State");
         return(Task.CompletedTask);
     });
 }
예제 #5
0
 public static IDisposable Subscribe(this IGrainLifecycle observable, GrainLifecycleStage stage, ILifecycleObserver observer)
 {
     return(observable.Subscribe((int)stage, observer));
 }
예제 #6
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe <TransactionalState <TState> >(GrainLifecycleStage.SetupState, OnSetupState);
 }
예제 #7
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe(GrainLifecycleStage.SetupState, OnSetupState);
 }
예제 #8
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe(OptionFormattingUtilities.Name <TableExampleStorage <TState> >(this.Name), GrainLifecycleStage.SetupState, LoadState);
 }
예제 #9
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe(this.GetType().FullName, GrainLifecycleStage.SetupState, OnSetupState);
 }
예제 #10
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe <TransactionalState <TState> >(GrainLifecycleStage.SetupState, (ct) => OnSetupState(ct, SetupResourceFactory));
 }
예제 #11
0
 public override void Participate(IGrainLifecycle lifecycle)
 {
     base.Participate(lifecycle);
 }
예제 #12
0
 public override void Participate(IGrainLifecycle lifecycle)
 {
     Console.WriteLine("Participate");
     base.Participate(lifecycle);
 }
예제 #13
0
 public void Participate(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe <FaultInjectionTransactionalState <TState> >(GrainLifecycleStage.SetupState,
                                                                      (ct) => this.txState.OnSetupState(ct, this.SetupResourceFactory));
 }
예제 #14
0
 public void Participate(IGrainLifecycle lifecycle) => base.Participate <NonFaultTolerantWorkflowIndexedState <TGrainState, TWrappedState> >(lifecycle);
예제 #15
0
 public void Participate(IGrainLifecycle lifecycle) => base.Participate <TransactionalIndexedState <TGrainState> >(lifecycle);
예제 #16
0
 public void Participate <TSubclass>(IGrainLifecycle lifecycle)
 {
     lifecycle.Subscribe <TSubclass>(GrainLifecycleStage.SetupState, _ => OnSetupStateAsync());
     lifecycle.Subscribe <TSubclass>(GrainLifecycleStage.Activate, ct => OnActivateAsync(ct), ct => OnDeactivateAsync(ct));
 }