rwait
1.1.4 • Public • Published rwait
Usage
const r = require('rethinkdbdash')({ host: 'localhost' })
const rwait = require('rwait')(r)
;(async () => {
try {
const pending = await rwait({
db: 'test',
table: 'test',
timeout: 2000,
filter: r.row('new_val')('id').eq('test')
})
// some operation that causes a write somewhere else....
process.nextTick(() => {
r.db('test').table('test').insert([ { id: 'test', value: 'hello world' } ]).run()
})
const value = await pending.value
console.log('got value', value)
} catch (err) {
console.error('error', err)
}
})()
license
Apache License, Version 2.0
Package Sidebar
Install
Weekly Downloads