private void HandleSecondAttemptCallback(CookFoodCalledBack m) { if (m.Attempt != 2 || _cooked) { return; } _dispatcher.Publish(new FailedToContactTheKitchen(m) { Order = m.Order }); _dispatcher.Publish(new OrderCompleted(m) { Order = m.Order, Success = false, Retried = true }); }
private void HandleFirstAttemptCallback(CookFoodCalledBack m) { if (m.Attempt != 1 || _cooked) { return; } _dispatcher.Publish(new CookFood(m) { Order = m.Order }); _dispatcher.Publish(new Callback(m) { Seconds = 2, Payload = new CookFoodCalledBack(m) { Attempt = 2, Order = m.Order } }); }
public void Handle(CookFoodCalledBack m) { Apply(m); HandleFirstAttemptCallback(m); HandleSecondAttemptCallback(m); }
public void Apply(CookFoodCalledBack e) { _calledback = true; }