Skip to content

Commit

Permalink
add examples to changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktrn committed Jan 13, 2025
1 parent ad8686e commit 60e12cb
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .changeset/gold-melons-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,32 @@
"@trigger.dev/core": patch
---

Add support for specifying machine preset at trigger time
Add support for specifying machine preset at trigger time. Works with any trigger function:

```ts
// Same as usual, will use the machine preset on childTask, defaults to "small-1x"
await childTask.trigger({ message: "Hello, world!" });

// This will override the task's machine preset and any defaults. Works with all trigger functions.
await childTask.trigger({ message: "Hello, world!" }, { machinePreset: "small-2x" });
await childTask.triggerAndWait({ message: "Hello, world!" }, { machinePreset: "small-2x" });

await childTask.batchTrigger([
{ payload: { message: "Hello, world!" }, options: { machinePreset: "micro" } },
{ payload: { message: "Hello, world!" }, options: { machinePreset: "large-1x" } },
]);
await childTask.batchTriggerAndWait([
{ payload: { message: "Hello, world!" }, options: { machinePreset: "micro" } },
{ payload: { message: "Hello, world!" }, options: { machinePreset: "large-1x" } },
]);

await tasks.trigger<typeof childTask>(
"child",
{ message: "Hello, world!" },
{ machinePreset: "small-2x" }
);
await tasks.batchTrigger<typeof childTask>("child", [
{ payload: { message: "Hello, world!" }, options: { machinePreset: "micro" } },
{ payload: { message: "Hello, world!" }, options: { machinePreset: "large-1x" } },
]);
```

0 comments on commit 60e12cb

Please sign in to comment.