Is there a way to pause and resume query output?
See original GitHub issueI’m using the eventEmitter model to handle the results from a query that produces a large number of rows. The handler has some async components, so I’d really like to be able to keep the next ‘row’ event from firing until after the current one has completed processing.
Ideally this would take to form of pause() and resume() calls on the query object itself.
var query = client.query("select * from big_data_table");
query.on('row', function (row) {
query.pause(); // turn off the firehose
return do_something_async(row, function() {
query.resume(); // turn back on the firehose
});
});
Issue Analytics
- State:
- Created 10 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Pause or Resume a Database Mirroring Session (SQL Server)
Learn how to pause and resume a SQL Server database mirroring session using SQL Server ... From the Standard bar, click New Query....
Read more >Is it possible to pause an SQL query? - Stack Overflow
I'm assuming the answer is 'NO' because of how rows and data gets locked, etc. I'm using Sql Server 2008, btw. tsql ·...
Read more >Automatic Pause and Resume of an Azure SQL database
This article will show how to automatic Pause and Resume an Azure SQL database.
Read more >sql server - Pause and resume execution of stored procedure
There's no clean way to just pause and resume a stored procedure, but you can have it sleep for a fixed period of...
Read more >Pause or Cancel a Search - Sumo Logic Docs
You can resume a paused search; just click Resume under the Start button. Cancel a Search. When you cancel a search, you are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brianc thank you for quick response! I ended up using query-stream.
@jgoux this worked for me buddy:
Cheers!
I’m interested as well. I’d like to handle an async process inside the
data
handler, and receive the next row only when my async process in the handler is over.