Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create WebSocket using Django-Channels that calls location API when any update Occurs #22

Closed
chetanzope opened this issue Jun 4, 2018 · 2 comments

Comments

@chetanzope
Copy link
Collaborator

No description provided.

@chetanzope chetanzope created this issue from a note in Live Location Tracker (In Progress) Jun 4, 2018
@chetanzope
Copy link
Collaborator Author

chetanzope commented Jun 5, 2018

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.

@chetanzope
Copy link
Collaborator Author

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.

Live Location Tracker automation moved this from In Progress to Done Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant