rpc-redis
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Rpc-redis - library for RPC via redis

Doc under construction

Listener example

const { RedisRpcFactory } = require('rpc-redis');

// instantinate RpcRedis with default settings
const rpc = RedisRpcFactory('test1');

// handle request
rpc.setRequestListener('test', (data) => {
    return data.test + 1;
});

// handle event
rpc.setEventListener('testEvent', (data) => {
    console.log(data);
});

// start listener
rpc.startListen();

Request example

const { RedisRpcFactory } = require('rpc-redis');

// instantinate RpcRedis with default settings
const rpc = RedisRpcFactory('test');

// start listen
rpc.startListen().then(() => {
    // send request
    rpc.sendRequest('test1', 'test', {
        test: 144
    }, true).then(console.log);
    
});

Dependencies (1)

Dev Dependencies (8)

Package Sidebar

Install

npm i rpc-redis

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

26.1 kB

Total Files

36

Last publish

Collaborators

  • slrv