kappa-db / kappa-core

Minimal peer-to-peer database, based on kappa architecture.
254 stars 22 forks source link

Count pause/resume operations #19

Open hackergrrl opened 4 years ago

hackergrrl commented 4 years ago

I could see it being useful for one piece of code to call pause on some kappa views, and expect it to stay paused until it finished. Currently, it's a binary on/off switch, so one piece of code could unpause when another piece of code is relying on the indexes to be paused in order to, for example, issue several queries without wanting the views to change underneath it while it does so.

This could be done by just having a pauseCount for each view kappa-core tracks, and only issuing ready once it reaches 0 again.

cc @Frando