@effect-firebase/admin wraps callable, request, Firestore document, task queue, and Pub/Sub triggers — but not scheduled functions. Cron jobs still have to use firebase-functions/v2/scheduler's onSchedule directly and hand-roll the Effect runtime bootstrapping that the other wrappers provide.
Motivation
Scheduled functions are a staple of most Firebase backends (cleanup jobs, digests, syncs). They're often the same code that already runs inside Effect via the other wrappers, so the missing wrapper forces an awkward seam: either wrap the handler body in a manual Runtime.runPromise, or keep scheduled functions outside Effect entirely.
Suggested shape
An onScheduleEffect in the style of the existing wrappers (onCallEffect, onTaskDispatchedEffect, onMessagePublishedEffect):
export const cleanup = onScheduleEffect(
{ schedule: 'every 24 hours' },
(event) =>
Effect.gen(function* () {
// ...
}),
runtime
);
Scheduled events carry no payload beyond ScheduledEvent metadata (jobName, scheduleTime), so no schema decoding is needed — this should be one of the simpler triggers to add.
@effect-firebase/adminwraps callable, request, Firestore document, task queue, and Pub/Sub triggers — but not scheduled functions. Cron jobs still have to usefirebase-functions/v2/scheduler'sonScheduledirectly and hand-roll the Effect runtime bootstrapping that the other wrappers provide.Motivation
Scheduled functions are a staple of most Firebase backends (cleanup jobs, digests, syncs). They're often the same code that already runs inside Effect via the other wrappers, so the missing wrapper forces an awkward seam: either wrap the handler body in a manual
Runtime.runPromise, or keep scheduled functions outside Effect entirely.Suggested shape
An
onScheduleEffectin the style of the existing wrappers (onCallEffect,onTaskDispatchedEffect,onMessagePublishedEffect):Scheduled events carry no payload beyond
ScheduledEventmetadata (jobName,scheduleTime), so no schema decoding is needed — this should be one of the simpler triggers to add.