Skip to content

Commit

Permalink
add publish command for async interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sewenew committed Jul 12, 2022
1 parent f06ab7a commit ce6673d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sw/redis++/async_redis.h
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,11 @@ class AsyncRedis {
return _command<long long>(fmt::publish, channel, message);
}

template <typename Callback>
void publish(const StringView &channel, const StringView &message, Callback &&cb) {
_callback_fmt_command<long long>(std::forward<Callback>(cb), fmt::publish, channel, message);
}

// co_command* are used internally. DO NOT use them.

template <typename Result, typename Callback>
Expand Down
5 changes: 5 additions & 0 deletions src/sw/redis++/async_redis_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,11 @@ class AsyncRedisCluster {
return _command<long long>(fmt::publish, channel, message);
}

template <typename Callback>
void publish(const StringView &channel, const StringView &message, Callback &&cb) {
_callback_fmt_command<long long>(std::forward<Callback>(cb), fmt::publish, channel, message);
}

// co_command* are used internally. DO NOT use them.

template <typename Result, typename Callback>
Expand Down

0 comments on commit ce6673d

Please sign in to comment.