Node-mysql Query.stream test
✓ Published0🌍 Public
ZZJONSSON
Last edited Apr 5, 2013
Created on Apr 4, 2013
This example demonstrates how the node-mysql Query.stream() method handles automatic backpressure by pausing data emission when a downstream writable stream is slow. A MySQL query streams rental records from the sakila.rental table through a custom stream.Writable that delays each write by 500 milliseconds, while the code logs every incoming result event. The mysql connection and Query.stream() API control the flow, and the writable’s highWaterMark settings trigger the pause behavior when the buffer fills.
AI-generated descriptionTesting automatic pause/resume in node-mysql Query.stream() in https://github.com/ZJONSSON/node-mysql/commit/eb4410bbc1e4496cbac66fe56f32225e55f7e463