attachScheduledHandler function

void attachScheduledHandler(
  1. CloudflareWorkersScheduledEvent handler
)

Implementation

void attachScheduledHandler(CloudflareWorkersScheduledEvent handler) {
  globalDartScheduledHandler = allowInterop((interop.ScheduledEvent event,
      interop.Environment env, interop.ExecutionContext ctx) {
    return futureToPromise(Future(() async {
      return handler(
        scheduledEventFromJsObject(event),
        environmentFromJsObject(env),
        executionContextFromJsObject(ctx),
      );
    }));
  });
}