Cloudflare DevelopersCD
Cloudflare Developersโ€ข4y agoโ€ข
8 replies
MrBBot

Hey ๐Ÿ‘‹ For now you ll need to define

Hey! ๐Ÿ‘‹ For now, you'll need to define your own
ExecutionContext
class:
class ExecutionContext {
  promises = [];
  waitUntil(promise) { this.promises.push(promise); }
  passThroughOnException() {}
}
...
const env = getMiniflareBindings();
const ctx = new ExecutionContext();
const response = await worker.fetch(request, env, ctx);
await Promise.all(ctx.promises);

A better solution is in the works though. ๐Ÿ™‚
Was this page helpful?