Ejemplo n.º 1
0
        public void Handle(CustomerCreated message)
        {
            if (Data.Customer != null)
            {
                return;
            }

            flowLog.LogFlow(message.CustomerId, "Created customer saga for {0}", message.Name);

            Data.Customer = new CustomerInformation
            {
                CustomerId = message.CustomerId,
                Name       = message.Name,
            };
        }
Ejemplo n.º 2
0
        public void Handle(CustomerCreated message)
        {
            // we're idempotent!
            if (Data.CustomerId != Guid.Empty)
            {
                return;
            }

            var customerId = message.CustomerId;

            flowLog.LogFlow(customerId, "Commencing legal check of {0}", message.Name);

            Data.CustomerId = customerId;

            bus.Defer(8.Seconds(), new SimulatedLegalCheckComplete {
                CustomerId = customerId
            });
        }
Ejemplo n.º 3
0
        public void Handle(CustomerCreated message)
        {
            // we're idempotent!
            if (Data.CustomerInfo != null)
            {
                return;
            }

            var customerId = message.CustomerId;

            flowLog.LogFlow(customerId, "Commencing credit check of {0}", message.Name);

            Data.CustomerInfo = new CustomerInfo
            {
                CustomerId   = customerId,
                CustomerName = message.Name,
            };

            bus.Defer(random.Next(5).Seconds() + 5.Seconds(),
                      new SimulatedCreditCheckComplete {
                CustomerId = customerId
            });
        }