Inheritance: IEnumerable
Exemplo n.º 1
0
        static SagaTaskManager RunSaga(MessagingFactory workersMessageFactory, CancellationTokenSource terminator)
        {
            var saga = new SagaTaskManager(workersMessageFactory, terminator.Token)
            {
                { BookRentalCarQueueName, TravelBookingHandlers.BookRentalCar, BookHotelQueueName, CancelRentalCarQueueName },
                { CancelRentalCarQueueName, TravelBookingHandlers.CancelRentalCar, SagaResultQueueName, string.Empty },
                { BookHotelQueueName, TravelBookingHandlers.BookHotel, BookFlightQueueName, CancelHotelQueueName },
                { CancelHotelQueueName, TravelBookingHandlers.CancelHotel, CancelRentalCarQueueName, string.Empty },
                { BookFlightQueueName, TravelBookingHandlers.BookFlight, SagaResultQueueName, CancelFlightQueueName },
                { CancelFlightQueueName, TravelBookingHandlers.CancelFlight, CancelHotelQueueName, string.Empty }
            };

            return(saga);
        }
 static SagaTaskManager RunSaga(MessagingFactory workersMessageFactory, CancellationTokenSource terminator)
 {
     var saga = new SagaTaskManager(workersMessageFactory, terminator.Token)
     {
         {BookRentalCarQueueName, TravelBookingHandlers.BookRentalCar, BookHotelQueueName, CancelRentalCarQueueName},
         {CancelRentalCarQueueName, TravelBookingHandlers.CancelRentalCar, SagaResultQueueName, string.Empty},
         {BookHotelQueueName, TravelBookingHandlers.BookHotel, BookFlightQueueName, CancelHotelQueueName},
         {CancelHotelQueueName, TravelBookingHandlers.CancelHotel, CancelRentalCarQueueName, string.Empty},
         {BookFlightQueueName, TravelBookingHandlers.BookFlight, SagaResultQueueName, CancelFlightQueueName},
         {CancelFlightQueueName, TravelBookingHandlers.CancelFlight, CancelHotelQueueName, string.Empty}
     };
     return saga;
 }