Skip to content

createChangeStreamHandler

createChangeStreamHandler(log, options?): object

Defined in: libs/runtime/src/change-stream.ts:125

The change stream as a request handler, so a hub can mount it under its own routes and put its own authentication in front.

  • GET <path> — SSE. Resumes from Last-Event-ID, or ?since=, or the beginning.
  • POST <path> — accept revisions pushed by a spoke.

path is where the handler believes it is mounted (default /changes); anything else is a 404. close() ends every open stream — without that, a held-open response keeps the process alive and a test hangs rather than failing.

ChangeLog

ChangeStreamOptions & object = {}

object

close: () => void

void

handle: (request, response) => void

IncomingMessage

ServerResponse

void

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.