Spaces:
Sleeping

teamta / src /interfaces /core /IMessageQueueAPI.ts
lamsaoganh's picture
Upload 62 files
1305386 verified
Raw History Blame Contribute Delete
1.02 kB
import { IMessage } from "./IMessage";
import { IWorkerRegistry } from "./IWorkerRegistry";
export interface IMessageQueueAPI {
getPrioritizedMessagesToRun({ workerRegistryData }: { workerRegistryData: IWorkerRegistry }): Promise<IMessage[]>;
updateMessageStatus({ messageId, status, result, workerRegistry }: { messageId: string, status: string, result?: any, workerRegistry?: IWorkerRegistry }): Promise<void>;
updateMessageProgress({ messageId, progress }: { messageId: string, progress: number }): Promise<void>;
updateMessageResultAndStatus({ messageId, status, result, workerRegistry }: { messageId: string, status: string, result?: any, workerRegistry?: IWorkerRegistry }): Promise<void>;
createMessage({ messageData }: { messageData: IMessage }): Promise<IMessage>;
createMessages({ messagesData }: { messagesData: IMessage[] }): Promise<IMessage[]>;
getMessagesByRequestId({ requestId }: { requestId: string }): Promise<IMessage[]>;
healthCheck(): Promise<boolean>;
}