2023-08-10 16:32:41 +00:00
|
|
|
import { syscall } from "$sb/plugos-syscall/syscall.ts";
|
2023-08-11 18:37:13 +00:00
|
|
|
import { QueueStats } from "$sb/types.ts";
|
2023-08-10 16:32:41 +00:00
|
|
|
|
|
|
|
export function send(queue: string, body: any) {
|
|
|
|
return syscall("mq.send", queue, body);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function batchSend(queue: string, bodies: any[]) {
|
|
|
|
return syscall("mq.batchSend", queue, bodies);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ack(queue: string, id: string) {
|
|
|
|
return syscall("mq.ack", queue, id);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function batchAck(queue: string, ids: string[]) {
|
|
|
|
return syscall("mq.batchAck", queue, ids);
|
|
|
|
}
|
2023-08-11 18:37:13 +00:00
|
|
|
|
|
|
|
export function getQueueStats(queue: string): Promise<QueueStats> {
|
|
|
|
return syscall("mq.getQueueStats", queue);
|
|
|
|
}
|