Closed chetanzope closed 6 years ago
After this, we used an action called subscribe. Subscribe action is used to notify the client if some action(Create, Update, Delete) happens. So whenever we get the locations from GPSLogger App, it notifies the client via message(Redis-Message). This message is generally a JSON response in which we got the updated lat-long and we show them on the map.
In this, we created a simple WebSocket connection between client and server. We used Redis as channel layers. CHANNEL_LAYERS is the transport mechanism that channel uses to pass messages from producer to consumer. In CHANNEL_LAYERS, we’ve told Channel where to look for our channel routing. Channel routing is a very similar concept to URL routing: URL routing maps URLs to view functions; channel routing maps channels to consumer functions. -- This is about what to use for WebSocket.