import { EventEmitter } from "node:events"; import { Transport } from "./transport.js"; import { Cluster } from "./cluster.js"; import { VectorClock } from "./vector_clock.js"; import { Registry, ActorLocation } from "./registry.js"; export interface ActorRegistration { name: string; nodeId: string; actorId: string; generation: number; vectorClock: VectorClock; } export interface RegistryUpdate { type: "register" | "unregister"; registration: ActorRegistration; } /** * RegistryGossip manages the distributed actor registry using eventual consistency. * * It uses: * - ZeroMQ PUB/SUB for fast registry update propagation * - Vector clocks for conflict resolution * - Automatic cleanup when nodes die * * Events: * - 'actor_registered': Emitted when a new actor is registered * - 'actor_unregistered': Emitted when an actor is unregistered * - 'actor_updated': Emitted when actor registration is updated (moved nodes, etc.) */ export declare class RegistrySync extends EventEmitter implements Registry { private nodeId; private transport; private membership; private localClock; private registrations; constructor(nodeId: string, transport: Transport, membership: Cluster); connect(): Promise; disconnect(): Promise; /** * Registers an actor name to its location. * This updates the local registry and broadcasts to all peers. * @param name The name of the actor * @param nodeId The ID of the node where the actor resides * @param actorId The actor's unique instance ID */ register(name: string, nodeId: string, actorId: string): Promise; /** * Re-publish all local registrations to PUB/SUB. * Used for anti-entropy when SUB connections may have been * established after the original registration was published. */ republishAll(): void; /** * Unregisters an actor name from the registry. * @param name The name of the actor to unregister */ unregister(name: string): Promise; /** * Looks up the location for a given actor name. * @param name The name of the actor * @returns The actor location, or null if not found */ lookup(name: string): Promise; /** * Gets all actor names registered to a specific node. * @param nodeId The ID of the node * @returns An array of actor names */ getNodeActors(nodeId: string): Promise; /** * Gets all registrations (for debugging/testing). */ getAllRegistrations(): Map; private handleRegistryUpdate; private handlePeerLeave; private handlePeerJoin; private syncPeers; private serializeRegistration; private deserializeRegistration; } //# sourceMappingURL=registry_sync.d.ts.map