multileveldown
multileveldown copied to clipboard
Immediately unref the `ref` provided to `createRpcStream()`
Copied from https://github.com/Level/party/issues/28#issuecomment-1065596009: we don't initially unref. You must make at least one db operation for the logic to work. So this hangs:
const name = Date.now().toString()
const db1 = party(name)
const db2 = party(name)
await db1.open()
await db2.open()
console.log('opened')
// Comment this out to not make the event loop hang
// await db1.put('a', 'b')
// console.log(await db2.get('a'))
On second thought, it might make more sense to do this (i.e. deciding the initial unref/reffed state) in level-party.