Refactor all the things
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { syscall } from "$sb/plugos-syscall/syscall.ts";
|
||||
import { QueueStats } from "$sb/types.ts";
|
||||
import { MQStats } from "$sb/types.ts";
|
||||
|
||||
export function send(queue: string, body: any) {
|
||||
return syscall("mq.send", queue, body);
|
||||
@@ -17,6 +17,6 @@ export function batchAck(queue: string, ids: string[]) {
|
||||
return syscall("mq.batchAck", queue, ids);
|
||||
}
|
||||
|
||||
export function getQueueStats(queue: string): Promise<QueueStats> {
|
||||
export function getQueueStats(queue: string): Promise<MQStats> {
|
||||
return syscall("mq.getQueueStats", queue);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
import type { CommandDef } from "../../web/hooks/command.ts";
|
||||
import { syscall } from "./syscall.ts";
|
||||
|
||||
export function invoke(
|
||||
name: string,
|
||||
...args: any[]
|
||||
): Promise<any> {
|
||||
return syscall("system.invoke", name, ...args);
|
||||
}
|
||||
|
||||
// @deprecated use invoke instead
|
||||
export function invokeFunction(
|
||||
env: string,
|
||||
name: string,
|
||||
...args: any[]
|
||||
): Promise<any> {
|
||||
return syscall("system.invokeFunction", env, name, ...args);
|
||||
return syscall("system.invokeFunction", name, ...args);
|
||||
}
|
||||
|
||||
// Only available on the client
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "$sb/silverbullet-syscall/mod.ts";
|
||||
export * from "$sb/plugos-syscall/mod.ts";
|
||||
+7
-2
@@ -1,16 +1,21 @@
|
||||
export type Message = {
|
||||
export type MQMessage = {
|
||||
id: string;
|
||||
queue: string;
|
||||
body: any;
|
||||
retries?: number;
|
||||
};
|
||||
|
||||
export type QueueStats = {
|
||||
export type MQStats = {
|
||||
queued: number;
|
||||
processing: number;
|
||||
dlq: number;
|
||||
};
|
||||
|
||||
export type MQSubscribeOptions = {
|
||||
batchSize?: number;
|
||||
pollInterval?: number;
|
||||
};
|
||||
|
||||
export type FileMeta = {
|
||||
name: string;
|
||||
lastModified: number;
|
||||
|
||||
Reference in New Issue
Block a user