...
How this works is that each Mobile Order is given a fixed Processing Time
defined in this Sanity the Restaurant document above. Every time this service the Wait Time Service receives an order, it estimates, based on past orders, if the kitchen is busy. If it is busy, the service holds the order in a queue to be inserted to the POS later. Else, it inserts the order immediately, and increase the busyness of the kitchen.
We measure kitchen “busyness” by checking recent orders being made to the kitchen. Since each order has a Processing Time
we can estimate at any point in time, the Time to Clear Kitchen (TCK) off . This is the time needed for the kitchen to complete all mobile orders. We consider a kitchen to by be busy when the next order Processing Time + TCK
is larger than the Busy Kitchen Threshold
set above.
...