From 2f66550729924ccfc20c1418f498f21e0e4bdeca Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 22 Jun 2015 13:40:26 +0200 Subject: [PATCH] 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. --- src/geo.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/geo.c b/src/geo.c index 8ab04eb3..4663a2e5 100644 --- a/src/geo.c +++ b/src/geo.c @@ -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: " " */ - sds event = sdscatprintf(sdsempty(), "%.7f %.7f", latitude, longitude); - robj *eventobj = createObject(REDIS_STRING, event); - - /* channel is: __geo:: */ - /* If you want all events for this zset then just psubscribe - * to "__geo::*" */ - 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. */