CustomerOrder.Actor.CustomerOrderActor.ReceiveReminderAsync C# (CSharp) Method

ReceiveReminderAsync() public method

public ReceiveReminderAsync ( string reminderName, byte context, System.TimeSpan dueTime, System.TimeSpan period ) : Task
reminderName string
context byte
dueTime System.TimeSpan
period System.TimeSpan
return Task
        public async Task ReceiveReminderAsync(string reminderName, byte[] context, TimeSpan dueTime, TimeSpan period)
        {
            switch (reminderName)
            {
                case CustomerOrderReminderNames.FulfillOrderReminder:

                    await this.FulfillOrderAsync();

                    CustomerOrderStatus orderStatus = await this.GetOrderStatusAsync();

                    if (orderStatus == CustomerOrderStatus.Shipped || orderStatus == CustomerOrderStatus.Canceled)
                    {
                        //Remove fulfill order reminder so Actor can be gargabe collected.
                        IActorReminder orderReminder = this.GetReminder(CustomerOrderReminderNames.FulfillOrderReminder);
                        await this.UnregisterReminderAsync(orderReminder);
                    }

                    break;

                default:
                    // We should never arrive here normally. The system won't call reminders that don't exist. 
                    // But for our own sake in case we add a new reminder somewhere and forget to handle it, this will remind us.
                    throw new InvalidOperationException("Unknown reminder: " + reminderName);
            }
        }