operation.hpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #ifndef BOOST_REDIS_OPERATION_HPP
  7. #define BOOST_REDIS_OPERATION_HPP
  8. namespace boost::redis {
  9. /** @brief Connection operations that can be cancelled.
  10. *
  11. * The operations listed below can be passed to the
  12. * @ref boost::redis::connection::cancel member function.
  13. */
  14. enum class operation
  15. {
  16. /**
  17. * @brief (Deprecated) Resolve operation.
  18. *
  19. * Cancelling a single resolve operation is probably not what you
  20. * want, since there is no way to detect when a connection is performing name resolution.
  21. * Use @ref operation::run to cancel the current @ref basic_connection::async_run operation,
  22. * which includes name resolution.
  23. */
  24. resolve,
  25. /**
  26. * @brief (Deprecated) Connect operation.
  27. *
  28. * Cancelling a single connect operation is probably not what you
  29. * want, since there is no way to detect when a connection is performing a connect operation.
  30. * Use @ref operation::run to cancel the current @ref basic_connection::async_run operation,
  31. * which includes connection establishment.
  32. */
  33. connect,
  34. /**
  35. * @brief (Deprecated) SSL handshake operation.
  36. *
  37. * Cancelling a single connect operation is probably not what you
  38. * want, since there is no way to detect when a connection is performing an SSL handshake.
  39. * Use @ref operation::run to cancel the current @ref basic_connection::async_run operation,
  40. * which includes the SSL handshake.
  41. */
  42. ssl_handshake,
  43. /// Refers to `connection::async_exec` operations.
  44. exec,
  45. /// Refers to `connection::async_run` operations.
  46. run,
  47. /// Refers to `connection::async_receive` operations.
  48. receive,
  49. /**
  50. * @brief (Deprecated) Cancels reconnection.
  51. *
  52. * Cancelling reconnection doesn't really cancel anything.
  53. * It will only prevent further connections attempts from being
  54. * made once the current connection encounters an error.
  55. *
  56. * Use @ref operation::run to cancel the current @ref basic_connection::async_run operation,
  57. * which includes reconnection. If you want to disable reconnection completely,
  58. * set @ref config::reconnect_wait_interval to zero before calling `async_run`.
  59. */
  60. reconnection,
  61. /**
  62. * @brief (Deprecated) Health check operation.
  63. *
  64. * Cancelling the health checker only is probably not what you want.
  65. * Use @ref operation::run to cancel the current @ref basic_connection::async_run operation,
  66. * which includes the health checker. If you want to disable health checks completely,
  67. * set @ref config::health_check_interval to zero before calling `async_run`.
  68. */
  69. health_check,
  70. /// Refers to all operations.
  71. all,
  72. };
  73. } // namespace boost::redis
  74. #endif // BOOST_REDIS_OPERATION_HPP