@acuris/eventstore-api
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -5,10 +5,14 @@ "use strict"; | ||
constructor(streamWriter) { | ||
this.queue = []; | ||
this.streamWriter = streamWriter; | ||
} | ||
write(stream, events, expectedEventNumber) { | ||
return this.streamWriter.write(stream, events, expectedEventNumber); | ||
} | ||
flush() { | ||
this.queue.push([stream, events, expectedEventNumber]); | ||
return Promise.resolve(undefined); | ||
} | ||
async flush() { | ||
for (const [stream, events, expectedEventNumber] of this.queue) { | ||
await this.streamWriter.write(stream, events, expectedEventNumber); | ||
} | ||
} | ||
close() { | ||
@@ -15,0 +19,0 @@ } |
{ | ||
"name": "@acuris/eventstore-api", | ||
"private": false, | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "API for accessing event stores", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"jest": "^26.4.2", | ||
"ts-jest": "^26.4.0", | ||
"ts-jest": "^26.5.0", | ||
"typescript": "^4.0.3" | ||
@@ -33,0 +33,0 @@ }, |
18691
425