No, that was not my point. We should have separate timeouts for key1 and key2. Since nodejs is single threaded, there is no need to keep them in this special queue, and they will fire correctly and in order. Cancel can simply be clearTimeout(timeoutId[key]).