Search in sources :

Example 1 with GeoPositionDecoder

use of org.redisson.client.protocol.decoder.GeoPositionDecoder in project redisson by redisson.

the class RedissonGeo method posAsync.

@Override
public RFuture<Map<V, GeoPosition>> posAsync(V... members) {
    List<Object> params = new ArrayList<Object>(members.length + 1);
    params.add(getRawName());
    for (Object member : members) {
        params.add(encode(member));
    }
    MultiDecoder<Map<Object, Object>> decoder = new ListMultiDecoder2(new GeoPositionMapDecoder((List<Object>) Arrays.asList(members)), new GeoPositionDecoder());
    RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEOPOS", decoder);
    return commandExecutor.readAsync(getRawName(), StringCodec.INSTANCE, command, params.toArray());
}
Also used : GeoPositionMapDecoder(org.redisson.client.protocol.decoder.GeoPositionMapDecoder) ListMultiDecoder2(org.redisson.client.protocol.decoder.ListMultiDecoder2) RedisCommand(org.redisson.client.protocol.RedisCommand) GeoPositionDecoder(org.redisson.client.protocol.decoder.GeoPositionDecoder)

Aggregations

RedisCommand (org.redisson.client.protocol.RedisCommand)1 GeoPositionDecoder (org.redisson.client.protocol.decoder.GeoPositionDecoder)1 GeoPositionMapDecoder (org.redisson.client.protocol.decoder.GeoPositionMapDecoder)1 ListMultiDecoder2 (org.redisson.client.protocol.decoder.ListMultiDecoder2)1