@mastra/core
Version:
37 lines • 1.68 kB
TypeScript
import { PubSub } from './pubsub.js';
import type { PubSubDeliveryMode } from './pubsub.js';
import type { Event, EventCallback, SubscribeOptions } from './types.js';
type UnixSocketPubSubOptions = {
maxRemoteClientQueuedBytes?: number;
};
/**
* Max number of times a local subscriber callback may be redelivered after a
* nack. MUST be >= the consumer-side retry budget
* (`WorkflowEventProcessor.MAX_DELIVERY_ATTEMPTS`) — otherwise the transport
* gives up before the consumer can exhaust its budget and surface the terminal
* failure, which would leave the run silently hung.
*
* An invariant test in
* `packages/core/src/events/unix-socket-pubsub-redelivery-budget.test.ts`
* pins this ordering against the consumer constant so the two constants stay
* in sync as the consumer budget changes.
*/
export declare const MAX_LOCAL_REDELIVERIES = 6;
export declare class UnixSocketPubSub extends PubSub {
#private;
readonly socketPath: string;
constructor(socketPath: string, options?: UnixSocketPubSubOptions);
get supportedModes(): ReadonlyArray<PubSubDeliveryMode>;
get isBroker(): boolean;
/** Number of remote clients currently connected to this broker. Always 0 for non-broker instances. */
get remoteClientCount(): number;
publish(topic: string, event: Omit<Event, 'id' | 'createdAt'>, options?: {
localOnly?: boolean;
}): Promise<void>;
subscribe(topic: string, cb: EventCallback, options?: SubscribeOptions): Promise<void>;
unsubscribe(topic: string, cb: EventCallback): Promise<void>;
flush(): Promise<void>;
close(): Promise<void>;
}
export {};
//# sourceMappingURL=unix-socket-pubsub.d.ts.map