MCPcopy Create free account
hub / github.com/instantdb/instant / createReadStream

Method createReadStream

client/packages/core/src/Stream.ts:892–909  ·  view source on GitHub ↗
(opts: {
    clientId?: string | null | undefined;
    streamId?: string | null | undefined;
    byteOffset?: number | null | undefined;
    ruleParams?: RuleParams | null | undefined;
  })

Source from the content-addressed store, hash-verified

890 }
891
892 public createReadStream(opts: {
893 clientId?: string | null | undefined;
894 streamId?: string | null | undefined;
895 byteOffset?: number | null | undefined;
896 ruleParams?: RuleParams | null | undefined;
897 }) {
898 const { stream, addCloseCb } = createReadStream({
899 RStream: this.RStream,
900 opts,
901 startStream: this.startReadStream.bind(this),
902 cancelStream: this.cancelReadStream.bind(this),
903 });
904 this.activeStreams.add(stream);
905 addCloseCb(() => {
906 this.activeStreams.delete(stream);
907 });
908 return stream;
909 }
910
911 private startWriteStream(opts: {
912 clientId: string;

Callers

nothing calls this directly

Calls 4

createReadStreamFunction · 0.85
addCloseCbFunction · 0.85
bindMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected