2
0
mirror of https://github.com/boostorg/redis.git synced 2026-01-19 04:42:09 +00:00

Adds automatic formatting with clang-format

This commit is contained in:
Anarthal (Rubén Pérez)
2025-05-12 13:49:55 +02:00
committed by GitHub
parent 1060733b84
commit 328ad97a79
81 changed files with 1736 additions and 1589 deletions

View File

@@ -6,13 +6,15 @@
#include <boost/redis/connection.hpp>
#include <boost/redis/logger.hpp>
#include <boost/asio/awaitable.hpp>
#include <boost/asio/use_awaitable.hpp>
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/detached.hpp>
#include <boost/asio/consign.hpp>
#include <boost/asio/detached.hpp>
#include <boost/asio/redirect_error.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/asio/use_awaitable.hpp>
#include <iostream>
#if defined(BOOST_ASIO_HAS_CO_AWAIT)
@@ -47,8 +49,7 @@ using asio::signal_set;
*/
// Receives server pushes.
auto
receiver(std::shared_ptr<connection> conn) -> asio::awaitable<void>
auto receiver(std::shared_ptr<connection> conn) -> asio::awaitable<void>
{
request req;
req.push("SUBSCRIBE", "channel");
@@ -58,7 +59,6 @@ receiver(std::shared_ptr<connection> conn) -> asio::awaitable<void>
// Loop while reconnection is enabled
while (conn->will_reconnect()) {
// Reconnect to the channels.
co_await conn->async_exec(req, ignore);
@@ -72,13 +72,10 @@ receiver(std::shared_ptr<connection> conn) -> asio::awaitable<void>
}
if (ec)
break; // Connection lost, break so we can reconnect to channels.
break; // Connection lost, break so we can reconnect to channels.
std::cout
<< resp.value().at(1).value
<< " " << resp.value().at(2).value
<< " " << resp.value().at(3).value
<< std::endl;
std::cout << resp.value().at(1).value << " " << resp.value().at(2).value << " "
<< resp.value().at(3).value << std::endl;
consume_one(resp);
}
@@ -98,4 +95,4 @@ auto co_main(config cfg) -> asio::awaitable<void>
conn->cancel();
}
#endif // defined(BOOST_ASIO_HAS_CO_AWAIT)
#endif // defined(BOOST_ASIO_HAS_CO_AWAIT)