ChangeStreamHandlers
Defined in: libs/runtime/src/change-stream-client.ts:19
What a subscription calls as the hub’s stream delivers changes and as its own state changes.
Member summary
Section titled “Member summary”Methods
| Name | Description |
|---|---|
| onActive()? | Receiving changes from the hub. |
| onChange() | Called with each change, in order. |
| onFailed()? | 'transport' is the connection; 'apply' is onChange itself throwing. |
| onPaused()? | Caught up — nothing further for now. |
Methods
Section titled “Methods”onActive()?
Section titled “onActive()?”
optionalonActive():void
Defined in: libs/runtime/src/change-stream-client.ts:28
Receiving changes from the hub.
Returns
Section titled “Returns”void
onChange()
Section titled “onChange()”onChange(
record):void
Defined in: libs/runtime/src/change-stream-client.ts:24
Called with each change, in order. If it throws, the subscription stops without reconnecting and onFailed is
called with 'apply'; the change is not counted as seen, so a resume starts at it.
Parameters
Section titled “Parameters”record
Section titled “record”Returns
Section titled “Returns”void
onFailed()?
Section titled “onFailed()?”
optionalonFailed(error,cause?):void
Defined in: libs/runtime/src/change-stream-client.ts:35
'transport' is the connection; 'apply' is onChange itself throwing.
They are not the same failure and must not be retried the same way — a transport error is worth reconnecting through, while a handler that throws will throw again on the identical record.
Parameters
Section titled “Parameters”Error
cause?
Section titled “cause?”"transport" | "apply"
Returns
Section titled “Returns”void
onPaused()?
Section titled “onPaused()?”
optionalonPaused():void
Defined in: libs/runtime/src/change-stream-client.ts:26
Caught up — nothing further for now. Not a terminal state.
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.