UNPKG

@hotmeshio/hotmesh

Version:

Permanent-Memory Workflows & AI Agents

30 lines (29 loc) 1.62 kB
import { KeyStoreParams, KeyType } from '../../../../modules/key'; import { ILogger } from '../../../logger'; import { SubService } from '../../index'; import { SubscriptionCallback } from '../../../../types/quorum'; import { ProviderClient, ProviderTransaction } from '../../../../types/provider'; import { PostgresClientType } from '../../../../types/postgres'; declare class PostgresSubService extends SubService<PostgresClientType & ProviderClient> { private static clientSubscriptions; private static clientHandlers; private instanceSubscriptions; private instanceId; constructor(eventClient: PostgresClientType & ProviderClient, storeClient?: PostgresClientType & ProviderClient); init(namespace: string, appId: string, engineId: string, logger: ILogger): Promise<void>; private setupNotificationHandler; transact(): ProviderTransaction; mintKey(type: KeyType, params: KeyStoreParams): string; mintSafeKey(type: KeyType, params: KeyStoreParams): [string, string]; subscribe(keyType: KeyType.QUORUM, callback: SubscriptionCallback, appId: string, topic?: string): Promise<void>; unsubscribe(keyType: KeyType.QUORUM, appId: string, topic?: string): Promise<void>; /** * Cleanup method to remove all subscriptions for this instance. * Should be called when the SubService instance is being destroyed. */ cleanup(): Promise<void>; publish(keyType: KeyType.QUORUM, message: Record<string, any>, appId: string, topic?: string): Promise<boolean>; psubscribe(): Promise<void>; punsubscribe(): Promise<void>; } export { PostgresSubService };