The common use of a promise/deferred implementation is to create a promise, then after some asynchronous event occurs, decide whether to resolve or reject the promise.
Of course, once a promise has been resolved or rejected, its state cannot be changed -- it has been fulfilled.
What I am wondering is if there is a concept sort of similar to promises, but a kind of scenario in which the state might go back and forth.
For example, say a particular service is available every 5 minutes for a period of 60 seconds.
Whenever the service is available, any requests are fulfilled (passed to it) immediately. Whenever the service is unavailable, requests are pending and added to a queue, and as soon as the service becomes available, all backed-up requests in the queue are sent and fulfilled.
I know this concept isn't a promise, but I was wondering if this is an actual named situation in programming, and if there are existing library implementations of it (particularly in Node.js).
Did that make sense? Does such a thing exist?