You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 22, 2020. It is now read-only.
Please close After reviewing the skiff code I see that a call to skiff.levelup() creates a new levelup instance so my event listener was listening on a different instance
Playing around with skiff (using memdown) and I am attempting to get levelup put/del events from a 3 node skiff cluster. i have 1 node making a put request after the leader has been elected and i can see that the data is written. All 3 nodes run the same code on different ports in separate processes with the exception of node 3 calling a put after 2 seconds
pertinent code is
constdb=skiff.levelup()db.on('put',console.log)
I get no console output on any of the 3 nodes. Is there a way to achieve this?
importSkifffrom'skiff'importmemdownfrom'memdown'import_from'lodash'importpeerListfrom'./peer-list'exportdefaultfunctionnode(id){letstate=nullletloc=_.first(_.filter(peerList,(peer)=>peer.match(newRegExp(`${id}$`))!==null))letpeers=_.filter(peerList,(peer)=>peer.match(newRegExp(`${id}$`))===null)constoptions={db: memdown, peers }constskiff=Skiff(loc,options)constdb=skiff.levelup()db.on('put',console.log)skiff.start((err)=>{if(err)returnconsole.error(err)console.log('Skiff server started')})skiff.on('new state',(s)=>{if(s===state)returnstate=sconsole.log(`Became a ${s}`)})returnskiff}
Please close After reviewing the skiff code I see that a call to
skiff.levelup()
creates a new levelup instance so my event listener was listening on a different instancePlaying around with skiff (using memdown) and I am attempting to get levelup put/del events from a 3 node skiff cluster. i have 1 node making a put request after the leader has been elected and i can see that the data is written. All 3 nodes run the same code on different ports in separate processes with the exception of node 3 calling a put after 2 seconds
pertinent code is
I get no console output on any of the 3 nodes. Is there a way to achieve this?
Full code below
peer-list.js
node.js
node0.js
node1.js
node2.js
The text was updated successfully, but these errors were encountered: