`io.sendEvent()` allows you to send an event from inside a Job run. The sent event will trigger any Jobs that are listening for that event (based on the name). * @param cacheKey Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concept
(cacheKey: string | any[], event: SendEvent, options?: SendEventOptions)
| 732 | * @param options Options for sending the event. |
| 733 | */ |
| 734 | async sendEvent(cacheKey: string | any[], event: SendEvent, options?: SendEventOptions) { |
| 735 | return await this.runTask( |
| 736 | cacheKey, |
| 737 | async (task) => { |
| 738 | return await this._triggerClient.sendEvent(event, options); |
| 739 | }, |
| 740 | { |
| 741 | name: "Send Event", |
| 742 | params: { event, options }, |
| 743 | icon: "send", |
| 744 | properties: [ |
| 745 | { |
| 746 | label: "name", |
| 747 | text: event.name, |
| 748 | }, |
| 749 | ...(event?.id ? [{ label: "ID", text: event.id }] : []), |
| 750 | ...sendEventOptionsProperties(options), |
| 751 | ], |
| 752 | } |
| 753 | ); |
| 754 | } |
| 755 | |
| 756 | /** `io.sendEvents()` allows you to send multiple events from inside a Job run. The sent events will trigger any Jobs that are listening for those events (based on the name). |
| 757 | * @param cacheKey Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information. |
no test coverage detected