Skip to content

Commit 84f37e9

Browse files
authored
fix: add HPEXPIRE and HSETEX commands to pipeline object (#654)
1 parent a63ac43 commit 84f37e9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/sw/redis++/queued_redis.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,32 @@ class QueuedRedis {
801801
return command(cmd::hvals, key);
802802
}
803803

804+
template <typename Input>
805+
QueuedRedis& hsetex(const StringView &key, Input first, Input last, bool keep_ttl, HSetExOption opt) {
806+
range_check("HSETEX", first, last);
807+
808+
return command(cmd::hsetex_keep_ttl_range<Input>, key, first, last, keep_ttl, opt);
809+
}
810+
811+
template <typename Input>
812+
QueuedRedis& hsetex(const StringView &key, Input first, Input last, const std::chrono::milliseconds &ttl, HSetExOption opt) {
813+
range_check("HSETEX", first, last);
814+
815+
return command(cmd::hsetex_ttl_range<Input>, key, first, last, ttl, opt);
816+
}
817+
818+
template <typename Input>
819+
QueuedRedis& hpexpire(const StringView &key, Input first, Input last, const std::chrono::milliseconds &ttl, HPExpireOption opt) {
820+
range_check("HPEXPIRE", first, last);
821+
822+
return command(cmd::hpexpire_range<Input>, key, first, last, ttl, opt);
823+
}
824+
825+
template <typename Input>
826+
QueuedRedis& hpexpire(const StringView &key, Input first, Input last, const std::chrono::milliseconds &ttl) {
827+
return hpexpire(key, first, last, ttl, HPExpireOption::ALWAYS);
828+
}
829+
804830
// SET commands.
805831

806832
QueuedRedis& sadd(const StringView &key, const StringView &member) {

0 commit comments

Comments
 (0)