gr2m / spawn-pouchdb-server

Configurable per-app pouchdb-server as a drop-in replacement for CouchDB
27 stars 13 forks source link

Make the main process kill configurable #15

Closed jo closed 9 years ago

jo commented 9 years ago

When the pouchdb server exists, the main process is also killed.

I use spawn-pouchdb-server programatically in tests, where killing the main process is undesirable. I need a way to tell spawn-pouchdb-server not to kill the main process on exit, eg via an option: killMainProcessOnExit, which defaults to true to preserve backwards compatibility.

jo commented 9 years ago

This might not be useful as an option. Basically I want to manually stop the pouchdb server and don't want to exit the main process. But in case pouchdb server crashes for whatever reason I indeed want the main process to get killed.

We could expose a stop function which prevents the main process kill, but it would be quiet ugly.