Reputation: 845
I am working on a cab application. Case 1 : Now my driver is publishing their location on his channel(eg: ABCD) and all customer subscribes to that channel(eg : ABCD)
If their is multiple drivers then customer will subscribes to multiple channel and receive location from multiple drivers.
Case 2:
My driver publish location to multiple channels(i.e customer's channels) and customers listen to its channel.
I need to know which case is better and reliable. Thankyou
Upvotes: 1
Views: 598
Reputation: 6834
You are asking which model pattern is best when pairing Drivers and Passengers. There are many models which work well. However we recommend you follow a Geo Hashing and Proximity model which will be described in further detail as follows.
The link above will get you started. Essentially you want to follow the Geo Fencing Model which is similar to Geo Hashing by Proximity. You want to follow the Geofencing model as a Trigger for actions and alerts based on vehicle location and geographic boundaries (e.g. only vehicles within five miles get dispatch requests, customized traffic alerts, etc.). Create specific channels for individual geographic regions to target communications.
To connect groups of two or more people by location, you will need to take lat/long values and reduce the resolution of accuracy. By doing this, you can expand the coverage of proximity. You can use multiple resolutions at once or a fixed resolution.
Upvotes: 2