Sorry, but what does this actually do? I normally solve the problem described here by wrapping the fetch function with a resolving while and a timeout.
To summarize, our scheduler maintains state to allow retries to happen even if the application moves between compute instances, which is quite common when running in the cloud (e.g., deploying on autoscaling containers, or serverless functions).