Closed sheerun closed 5 years ago
Hi. Could you elaborate a bit on your use case? I’ll add setTimeout, as I know that cloudflare does support it, but I’m curious, as I’m not sure cloudflare guarantees that it will wait for your callback to fire. IAC I’ll fix this in a day or two.
@gja Cloudflare supports construct like await sleep(1000)
for the function above the same way as you can await fetch()
when fetching external resources from cloudflare workers scripts.
My use case is to wait 2 seconds before answering Nexmo webhook what would simulate 2s delay before picking up the call
The function I'm trying to use:
I can see similar method working in tutorials like this: https://scotthelme.co.uk/unleashing-the-power-of-cloudflare-workers/
While testing with this package I get: