Skip to content

Commit

Permalink
Merge pull request #41 from gelatodigital/feat/subscribe-arbitrary-task
Browse files Browse the repository at this point in the history
Feat: Subscribe Arbitrary Task
  • Loading branch information
bennoprice committed Dec 5, 2023
2 parents 01fdf8b + c4cea77 commit 74c1e75
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,20 @@ export class GelatoRelay {
offError = (handler: (error: Error) => void): void => {
this.#websocketHandler.offError(handler);
};

/**
* @param {string} taskId - Task Id
*
*/
subscribeTaskStatusUpdate = async (taskId: string): Promise<void> => {
await this.#websocketHandler.subscribe(taskId);
};

/**
* @param {string} taskId - Task Id
*
*/
unsubscribeTaskStatusUpdate = async (taskId: string): Promise<void> => {
await this.#websocketHandler.unsubscribe(taskId);
};
}

0 comments on commit 74c1e75

Please sign in to comment.