racer-rpc

0.1.10 • Public • Published

@deprecated package

I recommend to use racer-model-rpc instead of the current package


racer-rpc

Racer/Derby plugin for enabling RPC

How to use

After adding the plugin:

racer.use(require('racer-rpc'));

Use it below API:

API

On server:

// With callback
var backend = racer.createBackend(...);
backend.rpc.on('rpc-with-callback', function (arg1, arg2, cb) {
  arg1 === 'arg1' // true
  arg2 === 'arg2' // true
  cb(null, 'arg3', 'arg4');
});
 
// Without callback
backend.rpc.on('rpc-without-callback', function (arg1, arg2) {
  arg1 === 'arg1' // true
  arg2 === 'arg2' // true
});

On client:

// With callback
model.call('rpc-with-callback', 'arg1', 'arg2', function (err, arg3, arg4) {
  arg3 === 'arg3' // true
  arg4 === 'arg4' // true
});
 
// Without callback
model.call('rpc-withour-callback', 'arg1', 'arg2');

Dependents (1)

Package Sidebar

Install

npm i racer-rpc

Weekly Downloads

5

Version

0.1.10

License

MIT

Unpacked Size

5.7 kB

Total Files

4

Last publish

Collaborators

  • cjblomqvist
  • kolegm