2
0
mirror of https://github.com/boostorg/redis.git synced 2026-02-09 11:22:22 +00:00

Connection contructor takes an io_executor and not the io_context.

This commit is contained in:
Marcelo Zimbres
2021-08-07 12:17:48 +02:00
parent 92b885ba1e
commit d6e3a58ef8
6 changed files with 38 additions and 7 deletions

View File

@@ -17,12 +17,12 @@ void f(request& req)
req.quit();
}
class receiver : public receiver_base {
class myreceiver : public receiver_base {
private:
std::shared_ptr<connection> conn_;
public:
receiver(std::shared_ptr<connection> conn) : conn_{conn} { }
myreceiver(std::shared_ptr<connection> conn) : conn_{conn} { }
void on_hello(resp::array_type& v) noexcept override
{ conn_->send(f); }
@@ -40,8 +40,8 @@ public:
int main()
{
net::io_context ioc {1};
auto conn = std::make_shared<connection>(ioc);
receiver recv{conn};
auto conn = std::make_shared<connection>(ioc.get_executor());
myreceiver recv{conn};
conn->start(recv);
ioc.run();
}