Refactoring from ajax to websockets: recommended patterns and quick wins

I have a single page application that currently uses ajax and REST to talk to the server. I structure the code mainly using promises and deferred ones, and I use the pubsub broker to communicate between the components. In general, the code is structured to follow Zakas' offerings for a scalable application architecture .

I would like to at least partially move server interaction to websockets for both performance and ease of development. Some of the specific interactions that I plan to change for using web maps are as follows:

  • Chat functionality
  • Long-Term Feedback
  • Attribute updates of the objects currently being viewed (for example, someone POSTs to the REST endpoint that corresponds to the object I'm currently viewing)

My question is:

Thanks.

EDIT

Hera - these are some related questions that I found after I introduced this. They are most closely related to the last part of my question (does 100% of websites really make sense).

+4
1

, , PubSub, RPC ( WebSocket) . , : WAMP.

post, Ajax WebSocket, WAMP, Autobahn Crossbar.io.

: WAMP, Autobahn Crossbar.io Tavendo.

+2

All Articles