Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
interface ResultStreamObserver
implements StreamObserver
import { type ResultStreamObserver } from "https://deno.land/x/neo4j_lite_client@4.4.6/core/internal/observers.ts";

Raw observer for the stream

Methods

cancel(): void

Cancel pending record stream

prepareToHandleSingleResponse(): void

Stream observer defaults to handling responses for two messages: RUN + PULL_ALL or RUN + DISCARD_ALL. Response for RUN initializes query keys. Response for PULL_ALL / DISCARD_ALL exposes the result stream.

However, some operations can be represented as a single message which receives full metadata in a single response. For example, operations to begin, commit and rollback an explicit transaction use two messages in Bolt V1 but a single message in Bolt V3. Messages are RUN "BEGIN" {} + PULL_ALL in Bolt V1 and BEGIN in Bolt V3.

This function prepares the observer to only handle a single response message.

markCompleted(): void

Mark this observer as if it has completed with no metadata.

subscribe(observer: ResultObserver): void

Subscribe to events with provided observer.