uber-archive / multitransport-jsonrpc

JSON-RPC Client (Node.js & Browser) and Server (Node.js) aim at "natural looking" server and client code.
116 stars 22 forks source link

TCP Client Constructor Change #49

Closed dfellis closed 10 years ago

dfellis commented 10 years ago

Change the Client TCP Transport constructor from separate host/port arguments to accept an object instead. This will allow connecting to a FIFO instead. Addresses issue #48

Raynos commented 10 years ago

Do we want back compat with host & port ?

We can do an

if (typeof host === 'string') {
  this.tcpConfig = {
    host: host,
    port: port
  }
} else {
  this.tcpConfig = host
}
dfellis commented 10 years ago

Would need to be a bit more complicated than that, though, because arguments.length is different in the two scenarios. But perhaps we should do a little bit of extra legwork here.

Raynos commented 10 years ago

@dfellis do you want to change one of the tests back to host, port argument signature so we have a test for the backwards compat branch ?

dfellis commented 10 years ago

Sure.

dfellis commented 10 years ago

Squashed. @Raynos want to merge after its green (again)?

Raynos commented 10 years ago

@dfellis sure. its red though.

dfellis commented 10 years ago

Bah! Express 4.0.0 was just released and since it's only a dev dependency I starred it. Let me just set it to 3.x because I don't want to refactor that test right now.

Raynos commented 10 years ago

lol "express": "*"

Raynos commented 10 years ago

@dfellis dont upgrade express to 4.0. just delete the dependency later.