1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-02-19 12:04:54 +00:00

Implement ZSCAN Redis command.

This commit is contained in:
King_DuckZ 2016-06-13 16:20:54 +01:00
parent 78eee0e16f
commit 533b571771
2 changed files with 7 additions and 0 deletions

View file

@ -137,4 +137,8 @@ namespace redis {
auto Command::sscan (boost::string_ref parKey) -> sscan_range {
return sscan_range(sscan_iterator(this, parKey, false), sscan_iterator(this, parKey, true));
}
auto Command::zscan (boost::string_ref parKey) -> zscan_range {
return zscan_range(zscan_iterator(this, parKey, false), zscan_iterator(this, parKey, true));
}
} //namespace redis

View file

@ -43,6 +43,8 @@ namespace redis {
typedef boost::iterator_range<hscan_iterator> hscan_range;
typedef ScanIterator<ScanSingleValuesInKey<std::string>> sscan_iterator;
typedef boost::iterator_range<sscan_iterator> sscan_range;
typedef ScanIterator<ScanPairs<std::pair<std::string, std::string>, ScanCommands::ZSCAN>> zscan_iterator;
typedef boost::iterator_range<zscan_iterator> zscan_range;
Command ( std::string&& parAddress, uint16_t parPort );
~Command ( void ) noexcept;
@ -59,6 +61,7 @@ namespace redis {
scan_range scan ( void );
hscan_range hscan ( boost::string_ref parKey );
sscan_range sscan ( boost::string_ref parKey );
zscan_range zscan ( boost::string_ref parKey );
private:
using RedisConnection = std::unique_ptr<redisContext, void(*)(redisContext*)>;