示例#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());
         }
     });
 }
示例#2
0
 public override void OnEnter(ConsumerStateMachine stateMachine)
 {
     base.OnEnter(stateMachine);
     stateMachine.ScheduleTransitionTo(stateMachine._config.PollingInterval, this, new FetchingState());
 }