Hyperlinkv0.9.0-beta.0

Lookup

Lookup.changesconstsrc/Lookup.ts:551
Stream.Stream<
  DirectoryUpserted | DirectoryRemoved,
  never,
  Directory
>

Live directory membership push — sugar over Directory.changes.

Subscribe from a node process to notice A→B dial swaps (DirectoryUpserted with dialChanged: true) and rebind peer clients without restart.

yield* Lookup.changes.pipe(
  Stream.filter((e) => e._tag === "DirectoryUpserted" && e.dialChanged),
  Stream.runForEach((e) => Effect.logInfo(`dial moved ${e.entry.nodeKey}`)),
)
constructorsDirectory
Source src/Lookup.ts:5512 lines
export const changes: Stream.Stream<DirectoryChange, never, Directory> =
  Stream.unwrap(Effect.map(Directory, (dir) => dir.changes));
Referenced by 1 symbols