0.0.7 • Published 6 years ago

@verady/rpcsend v0.0.7

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

rpcSend

Intended to be a one to one relationship for a rpc method, so for every rpc method you should have a new instace of RPCSend.

const someRPCService = new RPCSend('add', 'http://localhost:3000');             // just hostname
const someOtherRPCService = new RPCSend('substract', null, 3000);               // just a port -- defaults to localhost
const someLastRPCService = new RPCSend('transform', '0.0.0.0', 3000);           // or both...
const someLoggedRPCService = new RPCSend('unicornBuilder', null, 3000, logger); // supports custom logging -- defaults to process

const continuousOptions = {
  args: ['arguments', ['in', 'a'], true, 'format'],
  trysBeforeError: 5,                                                           // how many times we try before we log something
  timeout: 3000,                                                                // how long to wait between each recursive call
  cb(err, somethingElse, itReallyDependsOnYourRPCServer) {                      // optional, otherwise it returns a promise according to (err, rpcErr, result) signature
   ... stuff ...
  }
}

someRPCService.run(continuousOptions).then(...stuff).catch(...handle);
0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago