1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-10 13:50:05 +00:00

chore(streamlog): optimise polling mechanism

This commit is contained in:
Krishna Acondy
2021-07-20 09:25:39 +01:00
parent 1594f0c7db
commit 5c8d311ae8
14 changed files with 624 additions and 230 deletions

View File

@@ -0,0 +1,15 @@
import { WriteStream } from 'fs'
export const writeStream = async (
stream: WriteStream,
content: string
): Promise<void> => {
return new Promise((resolve, reject) => {
stream.write(content + '\n\nnext chunk\n\n', (e) => {
if (e) {
return reject(e)
}
return resolve()
})
})
}