import { generateVirtualEvents } from "./virtual.js";
import { on } from "../schedule/index.js";
import { limited } from "../../limited/index.js";
import { dispatchScheduledDurableEvents } from "../schedule/dispatch-scheduled.js";
export * from "./virtual.js";
const VIRTUAL = "virtual";
export async function onVirtualEvent() {
    for await (const events of generateVirtualEvents()) {
        await limited(events.map(event => () => dispatchScheduledDurableEvents({
            event
        })));
    }
}
export const removeVirtualScheduledFunction = on(VIRTUAL, onVirtualEvent);
//# sourceMappingURL=index.js.map