Skip to content

Commit

Permalink
feat: subscribe arbitrary task
Browse files Browse the repository at this point in the history
  • Loading branch information
bennoprice committed Dec 4, 2023
1 parent 01fdf8b commit c4cea77
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 c4cea77

Please sign in to comment.