request.ipp 841 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Copyright (c) 2018-2024 Marcelo Zimbres Silva (mzimbres@gmail.com)
  2. *
  3. * Distributed under the Boost Software License, Version 1.0. (See
  4. * accompanying file LICENSE.txt)
  5. */
  6. #include <boost/redis/request.hpp>
  7. #include <string_view>
  8. namespace boost::redis::detail {
  9. auto has_response(std::string_view cmd) -> bool
  10. {
  11. if (cmd == "SUBSCRIBE")
  12. return true;
  13. if (cmd == "PSUBSCRIBE")
  14. return true;
  15. if (cmd == "UNSUBSCRIBE")
  16. return true;
  17. if (cmd == "PUNSUBSCRIBE")
  18. return true;
  19. return false;
  20. }
  21. request make_hello_request()
  22. {
  23. request req;
  24. req.push("HELLO", "3");
  25. return req;
  26. }
  27. } // namespace boost::redis::detail
  28. void boost::redis::request::append(const request& other)
  29. {
  30. payload_ += other.payload_;
  31. commands_ += other.commands_;
  32. expected_responses_ += other.expected_responses_;
  33. }