12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef BOOST_REDIS_HELPER_HPP
- #define BOOST_REDIS_HELPER_HPP
- #include <boost/asio/cancellation_type.hpp>
- namespace boost::redis::detail
- {
- template <class T>
- auto is_cancelled(T const& self)
- {
- return self.get_cancellation_state().cancelled() != asio::cancellation_type_t::none;
- }
- #define BOOST_REDIS_CHECK_OP0(X)\
- if (ec || redis::detail::is_cancelled(self)) {\
- X\
- self.complete(!!ec ? ec : asio::error::operation_aborted);\
- return;\
- }
- #define BOOST_REDIS_CHECK_OP1(X)\
- if (ec || redis::detail::is_cancelled(self)) {\
- X\
- self.complete(!!ec ? ec : asio::error::operation_aborted, {});\
- return;\
- }
- }
- #endif
|