Recently i had a situation where, there were few features which were supposed to present a popup or animation etc, depending on timeouts and user-actions. Requests was to synchronize them in such a way that no one overlaps, i.e if one popup is already there, other requests for popups etc are queued.
Now technically this were settimeouts, one solution was to use one variable and poll for it.Rather i created an api that presents a token, and user will have to release it once task completes. i.e. i queued every request if token wasn't available.
What you guys think, is it a rare scenario, can it be part of jquery?