Skip to content

Commit ce6673d

Browse files
committed
add publish command for async interface
1 parent f06ab7a commit ce6673d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/sw/redis++/async_redis.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,11 @@ class AsyncRedis {
991991
return _command<long long>(fmt::publish, channel, message);
992992
}
993993

994+
template <typename Callback>
995+
void publish(const StringView &channel, const StringView &message, Callback &&cb) {
996+
_callback_fmt_command<long long>(std::forward<Callback>(cb), fmt::publish, channel, message);
997+
}
998+
994999
// co_command* are used internally. DO NOT use them.
9951000

9961001
template <typename Result, typename Callback>

src/sw/redis++/async_redis_cluster.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,11 @@ class AsyncRedisCluster {
991991
return _command<long long>(fmt::publish, channel, message);
992992
}
993993

994+
template <typename Callback>
995+
void publish(const StringView &channel, const StringView &message, Callback &&cb) {
996+
_callback_fmt_command<long long>(std::forward<Callback>(cb), fmt::publish, channel, message);
997+
}
998+
994999
// co_command* are used internally. DO NOT use them.
9951000

9961001
template <typename Result, typename Callback>

0 commit comments

Comments
 (0)