US 12,438,962 B2
Architecture for timers as a service
Christopher Lintz, Franktown, CO (US); and Krishna Tushar Dharaiya, San Francisco, CA (US)
Assigned to Twilio Inc., San Francisco, CA (US)
Filed by Twilio Inc., San Francisco, CA (US)
Filed on Dec. 29, 2023, as Appl. No. 18/400,723.
Prior Publication US 2025/0220092 A1, Jul. 3, 2025
Int. Cl. H04L 69/28 (2022.01); H04L 47/625 (2022.01); H04L 67/10 (2022.01)
CPC H04L 69/28 (2013.01) [H04L 47/625 (2013.01); H04L 67/10 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method comprising:
receiving a request to create a timer, the request corresponding to a wait state condition, the request associated with an endpoint for a payload associated with an expiration of the timer;
creating the timer based on the wait state condition, the creating of the timer including publishing information pertaining to the timer in a database by storing the timer in a distributed in-memory queue identified by a key containing a tenant identifier, a time bucket interval corresponding to an expiration time of the time, and a shard identifier, wherein an order for the timer among a plurality of timers is determined by a threshold condition that is verified before publishing the timer to the distributed in-memory queue;
consuming the timer ahead of its expiration time by pre-positioning the timer in a min heap data structure, the consuming of the timer including processing the information pertaining to the timer using a plurality of processes configured as unique consumers of distributed in-memory queues, wherein the consuming includes proportionally processing the information pertaining to the timer using a first consumer group for current timer expirations and a second consumer group for unacknowledged timers; and
based on the expiration of the timer, sending the payload associated with the expiration of the timer to the endpoint corresponding with the timer.