For many years, the Remote Procedure Call (RPC) has been one of the most used means of making nodes talk to each other. In RPC there are two intervenients: the server, which hosts a series of procedures, and a client, which calls these procedures. In most RPC implementations, the client calls these procedures as if it was doing local calls, making the code look natural.
In Node.js with the browser you can use this module named rpc-stream to create a RPC channel between a server and a client. You can also make two of these channels on top of a duplex channel (like a sock.js websocket stream) to make the calls bi-directional: not only can the browser invoke procedures on the server, the server can also invoke procedures on the client by its own initiative.
In this post, we’re going to take the To-do application example we built in the previous post and modify it so that it uses an RPC Stream instead of an Event Stream.
Your new post is loading...
SocketStream is a new breed of web framework that uses websockets to push data to the browser in 'realtime'. It makes it easy to create blazing-fast, rich interfaces which behave more like desktop apps than traditional web apps of the past.