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 fromLast-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.
Parameters
Section titled “Parameters”options?
Section titled “options?”ChangeStreamOptions & object = {}
Returns
Section titled “Returns”object
close: () =>
void
Returns
Section titled “Returns”void
handle
Section titled “handle”handle: (
request,response) =>void
Parameters
Section titled “Parameters”request
Section titled “request”IncomingMessage
response
Section titled “response”ServerResponse
Returns
Section titled “Returns”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.