Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency issue? #1

Closed
heapwolf opened this issue Feb 18, 2014 · 4 comments
Closed

Dependency issue? #1

heapwolf opened this issue Feb 18, 2014 · 4 comments

Comments

@heapwolf
Copy link

Writing integration tests for my database now and noticed that reconnect (mux-demux) actually fails...

image

Perhaps there is something less intuitive requires to reconnect a multilevel client? The code (ideally) looks like this...

var multilevel = require('multilevel')
var reconnect = require('reconnect-net')
var net = require('net')
var manifest = require('manifest.json')
var db = multilevel.client(manifest)

reconnect(function (stream) {
  stream.pipe(db.createRpcStream()).pipe(stream)
}).connect(3000)

module.exports = db
@juliangruber
Copy link
Owner

can you try

var rpc = db.createRpcStream();
rpc.on('error', function(){});
stream.pipe(rpc).pipe(stream)

That should catch the mdm error.

@juliangruber
Copy link
Owner

This has also been discussed here: juliangruber/multilevel#42, I can't remember through why we introduced the {error:true}, meh :(

@heapwolf
Copy link
Author

ah! that does fix the problem!

@juliangruber
Copy link
Owner

i'll document it, it's still better to have to handle that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants