@nestjs/microservices
Advanced tools
Comparing version 10.2.3 to 10.2.4
{ | ||
"name": "@nestjs/microservices", | ||
"version": "10.2.3", | ||
"version": "10.2.4", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@microservices)", | ||
@@ -25,4 +25,4 @@ "author": "Kamil Mysliwiec", | ||
"devDependencies": { | ||
"@nestjs/common": "10.2.3", | ||
"@nestjs/core": "10.2.3" | ||
"@nestjs/common": "10.2.4", | ||
"@nestjs/core": "10.2.4" | ||
}, | ||
@@ -29,0 +29,0 @@ "peerDependencies": { |
@@ -183,3 +183,3 @@ "use strict"; | ||
let isComplete = false; | ||
let writing = false; | ||
let clearToWrite = true; | ||
const cleanups = []; | ||
@@ -192,4 +192,6 @@ const cleanup = () => { | ||
const write = (value) => { | ||
writing = true; | ||
call.write(value); | ||
// If the stream `write` returns `false`, we have | ||
// to wait for a drain event before writing again. | ||
// This is done to handle backpressure. | ||
clearToWrite = call.write(value); | ||
}; | ||
@@ -203,10 +205,6 @@ const done = () => { | ||
const drainHandler = () => { | ||
if (writing) { | ||
writing = false; | ||
if (!clearToWrite) { | ||
clearToWrite = true; | ||
if (buffer.length > 0) { | ||
// Write any queued values we have in | ||
// our buffer. Note that the `writing` boolean | ||
// flips from false to true synchronously in this case | ||
// that will prevent values arriving in our `next` call | ||
// below from being interleaved in the written output. | ||
// Write any queued values we have in our buffer. | ||
write(buffer.shift()); | ||
@@ -237,3 +235,8 @@ } | ||
next: (value) => { | ||
if (writing) { | ||
if (clearToWrite) { | ||
// If we're not currently writing, then | ||
// we can write the value immediately. | ||
write(value); | ||
} | ||
else { | ||
// If a value arrives while we're writing | ||
@@ -243,7 +246,2 @@ // then we queue it up to be processed FIFO. | ||
} | ||
else { | ||
// If we're not currently writing, then | ||
// we can write the value immediately. | ||
write(value); | ||
} | ||
}, | ||
@@ -250,0 +248,0 @@ error: (err) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
382201
9260