From c4cea77edc885a02780e354c1cb332abc1ee441e Mon Sep 17 00:00:00 2001 From: Ben Price Date: Mon, 4 Dec 2023 16:21:42 +0000 Subject: [PATCH] feat: subscribe arbitrary task --- src/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/index.ts b/src/index.ts index 7e41dce..325614d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 => { + await this.#websocketHandler.subscribe(taskId); + }; + + /** + * @param {string} taskId - Task Id + * + */ + unsubscribeTaskStatusUpdate = async (taskId: string): Promise => { + await this.#websocketHandler.unsubscribe(taskId); + }; }