Projektstart
This commit is contained in:
22
backend/node_modules/sonic-boom/fixtures/firehose.js
generated
vendored
Normal file
22
backend/node_modules/sonic-boom/fixtures/firehose.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
|
||||
const SonicBoom = require('..')
|
||||
|
||||
const out = new SonicBoom({ fd: process.stdout.fd })
|
||||
const str = Buffer.alloc(1000).fill('a').toString()
|
||||
|
||||
let i = 0
|
||||
|
||||
function write () {
|
||||
if (i++ === 10) {
|
||||
return
|
||||
}
|
||||
|
||||
if (out.write(str)) {
|
||||
write()
|
||||
} else {
|
||||
out.once('drain', write)
|
||||
}
|
||||
}
|
||||
|
||||
write()
|
||||
Reference in New Issue
Block a user