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

Method createWriteStream

client/packages/core/src/Stream.ts:873–890  ·  view source on GitHub ↗
(opts: {
    clientId: string;
    waitUntil?: (promise: Promise<any>) => void | null | undefined;
    ruleParams?: RuleParams | null | undefined;
  })

Source from the content-addressed store, hash-verified

871 }
872
873 public createWriteStream(opts: {
874 clientId: string;
875 waitUntil?: (promise: Promise<any>) => void | null | undefined;
876 ruleParams?: RuleParams | null | undefined;
877 }): InstantWritableStream<string> {
878 const { stream, addCompleteCb } = createWriteStream({
879 WStream: this.WStream,
880 startStream: this.startWriteStream.bind(this),
881 appendStream: this.appendStream.bind(this),
882 registerStream: this.registerWriteStream.bind(this),
883 opts,
884 });
885 this.activeStreams.add(stream);
886 addCompleteCb(() => {
887 this.activeStreams.delete(stream);
888 });
889 return stream;
890 }
891
892 public createReadStream(opts: {
893 clientId?: string | null | undefined;

Callers

nothing calls this directly

Calls 4

createWriteStreamFunction · 0.85
addCompleteCbFunction · 0.85
bindMethod · 0.80
deleteMethod · 0.45

Tested by

no test coverage detected