v2.2.0
·
942 commits
to main
since this release
Minor Changes
-
d0a8976: Add support for batching events.
Introduces a new configuration to function configurations.
batchEvents?: { maxSize: 100, timeout: "5s" }
This will take Inngest start execution when one of the following conditions are met.
- The batch is full
- Time is up
When the SDK gets invoked, the list of events will be available via a newly exported field
events.createFunction( { name: "my func", batchEvents: { maxSize: 100, timeout: "5s" } }, { event: "my/event" }, async ({ event, events, step }) => { // events is accessible with the list of events // event will still be a single event object, which will be the // 1st event of the list. const result = step.run("do something with events", () => { return events.map(() => doSomething()); }); return { success: true, result }; } );