3 ms·
RPC's over WebSockets is what will replace REST/Ajax. On the client-side you have code like this: clientapp.sendRPC.doSomething(123); And on the server you
by wavephorm 15y ago
RPC's over WebSockets is what will replace REST/Ajax.
On the client-side you have code like this:
clientapp.sendRPC.doSomething(123);
And on the server you write code to receive it:
serverapp.receiveRPC.doSomething = function(number) {
write(number)
};
No Ajax, no URLs, no REST-ful religion. In fact ajax just feels wrong now. I unfortunately have to add some backward compatibility to my websocket apps, and I just get this really icky feeling like I really shouldn't be doing this arcane stuff anymore.
- deno 15y agoREST is just a layer of indirection over a regular RPC backend anyway. It may be easier to reason about things like caching and side-effects on the HTTP level. Of course HATEOS is mostly useless, unless you can stay within the general purpose protocols, like AtomPub and extensions. > RPC's over WebSockets is what will replace REST/Ajax. If SPDY takes off, there’s hardly any advantage to WS besides push events. Stateless protocols are easier to scale.
- Joeri 15y agoYou don't need web sockets to do this. Check out ext.direct. It does exactly this over xhr. I do something similar, with json-rpc as intermediate. The problem with REST is that people try to wrap rpc-style api's in a restful container, and it just doesn't do that well enough.
- hello_moto 15y agoGWT has been doing RPC for years (since its inception). The best part is that you can have both approaches with GWT (RPC or AJAX).