Ejemplo n.º 1
0
 public override void OnEnter(ConsumerStateMachine stateMachine)
 {
     stateMachine.RunSafe(async() =>
     {
         var consumed = await stateMachine._fetchNext().ConfigureAwait(false);
         if (consumed)
         {
             stateMachine.TransitionTo(this, new FetchedState());
         }
         else if (_eventProducedSignalled)
         {
             stateMachine.ScheduleTransitionTo(stateMachine._config.PickNextInterval, this, new FetchingState());
         }
         else
         {
             stateMachine.TransitionTo(this, new FetchedEmptyState());
         }
     });
 }
Ejemplo n.º 2
0
 public override void OnEnter(ConsumerStateMachine stateMachine)
 {
     base.OnEnter(stateMachine);
     stateMachine.ScheduleTransitionTo(stateMachine._config.PollingInterval, this, new FetchingState());
 }