Events, Streams & Backpressure ကို API syntax အဖြစ်သာမမြင်ဘဲ event loop, backpressure, cancellation, resource lifetime နဲ့ partial failure ပါသော asynchronous I/O flow အဖြစ်နားလည်ပါ။ Blocking work ကို request path တွင်မထားပါနှင့်။
ပိုပြီးနားလည်ထားရမယ့် အချက်
Events, Streams & Backpressure ကို API syntax အဖြစ်သာမမြင်ဘဲ event loop, backpressure, cancellation, resource lifetime နဲ့ partial failure ပါသော asynchronous I/O flow အဖြစ်နားလည်ပါ။ Blocking work ကို request path တွင်မထားပါနှင့်။
လက်တွေ့အသုံးချမှု
Events, Streams & Backpressure example ကို concurrent requests, malformed input, timeout, cancellation, missing config, dependency failure နဲ့ shutdown cases ဖြင့်စမ်းပါ။ Blocking I/O, leaked handles နဲ့ unhandled rejection ရှိမရှိစစ်ပါ။
ဒီသင်ခန်းစာပြီးရင်
import { createReadStream, createWriteStream } from 'node:fs';
import { pipeline } from 'node:stream/promises';
import { createGzip } from 'node:zlib';
await pipeline(createReadStream('access.log'), createGzip(), createWriteStream('access.log.gz'));File အားလုံး memory ထဲမတင်ဘဲ compressed လုပ်မည်။ကိုယ်တိုင်စမ်းကြည့်ရန်
Events, Streams & Backpressure example ကို concurrent requests, malformed input, timeout, cancellation, missing config, dependency failure နဲ့ shutdown cases ဖြင့်စမ်းပါ။ Blocking I/O, leaked handles နဲ့ unhandled rejection ရှိမရှိစစ်ပါ။
Runtime သတိပေးချက်
Local happy path မှန်ရုံဖြင့် concurrency, timeout, security နဲ့ shutdown paths မှန်ပြီဟုယူဆခြင်း။
Streams — Node.js