Skip to content

Commit f2c021f

Browse files
Update Backpressure.js
1 parent aed8b0b commit f2c021f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎examples/Backpressure.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
* Data doesn't just, poof, immediately jump from your server to the receiver - the receiver has to actually... receive it.
55
* That happens with ACKs, controlling the transmission window.
66
*
7-
* This applies to _EVERYTHING_ computer science (not just uWS); files, sockets, queues, and so on. If you're building
8-
* web services without taking backpressure into account you're not developing proper solutions - you're fucking around.
7+
* See https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount
98
*
10-
* Any slow receiver can wreck your whole server if you're not taking backpressure into account.
9+
* Backpressure applies to all streams, files, sockets, queues, and so on. If you're building
10+
* web services without taking backpressure into account you're not developing proper solutions - you're dicking around.
1111
*
12-
* The following is a (preposterous) example of how data can be pushed according to backpressure.
12+
* Any slow receiver can DOS your whole server if you're not taking backpressure into account.
13+
*
14+
* The following is a (ridiculous) example of how data can be pushed according to backpressure.
1315
* Do not take this as a way to actually write code, this is horrible, but it shows the concept clearly.
1416
*
1517
*/
@@ -70,4 +72,4 @@ const app = uWS./*SSL*/App({
7072
setInterval(() => {
7173
console.log("Sent " + messages + " messages last second");
7274
messages = 0;
73-
}, 1000);
75+
}, 1000);

0 commit comments

Comments
 (0)