diff options
author | antirez <antirez@gmail.com> | 2015-06-22 13:40:26 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-06-22 14:18:18 +0200 |
commit | 2f66550729924ccfc20c1418f498f21e0e4bdeca (patch) | |
tree | b01cfe4f75eda1e9cf2d1129d0f8b32badb776ed | |
parent | fc03d08ee0bc7abcb5f036454458d5b085fff10c (diff) | |
download | redis-2f66550729924ccfc20c1418f498f21e0e4bdeca.tar.gz |
Geo: Pub/Sub feature removed
This feature apparently is not going to be very useful, to send a
GEOADD+PUBLISH combo is exactly the same. One that would make a ton of
difference is the ability to subscribe to a position and a radius, and
get the updates in terms of objects entering/exiting the area.
-rw-r--r-- | src/geo.c | 32 |
1 files changed, 0 insertions, 32 deletions
@@ -225,37 +225,6 @@ static list *membersOfAllNeighbors(robj *zobj, GeoHashRadius n, double x, return l; } -/* With no subscribers, each call of this function adds a median latency of 2 - * microseconds. */ -/* We aren't participating in any keyspace/keyevent notifications other than - * what's provided by the underlying zset itself, but it's probably not useful - * for clients to get the 52-bit integer geohash as an "update" value. */ -static int publishLocationUpdate(const sds zset, const sds member, - const double latitude, - const double longitude) { - int published; - - /* event is: "<latitude> <longitude>" */ - sds event = sdscatprintf(sdsempty(), "%.7f %.7f", latitude, longitude); - robj *eventobj = createObject(REDIS_STRING, event); - - /* channel is: __geo:<zset>:<member> */ - /* If you want all events for this zset then just psubscribe - * to "__geo:<zset>:*" */ - sds chan = sdsnewlen("__geo:", 6); - chan = sdscatsds(chan, zset); - chan = sdscatlen(chan, ":", 1); - chan = sdscatsds(chan, member); - robj *chanobj = createObject(REDIS_STRING, chan); - - published = pubsubPublishMessage(chanobj, eventobj); - - decrRefCount(chanobj); - decrRefCount(eventobj); - - return published; -} - /* Sort comparators for qsort() */ static int sort_gp_asc(const void *a, const void *b) { const struct geoPoint *gpa = a, *gpb = b; @@ -343,7 +312,6 @@ void geoAddCommand(redisClient *c) { rewriteClientCommandVector(client, 4, cmd, key, score, val); decrRefCount(score); zaddCommand(client); - publishLocationUpdate(key->ptr, val->ptr, latitude, longitude); } /* If we used a fake client, return a real reply then free fake client. */ |