Rename to async_op_base::invoke_now

This commit is contained in:
Vinnie Falco
2019-02-15 15:02:38 -08:00
parent a781285e2f
commit fdaf2ea7e1
20 changed files with 30 additions and 29 deletions

View File

@ -5,6 +5,7 @@ Version 215:
* bind_front_handler works with member functions * bind_front_handler works with member functions
* Examples use bind_front_handler * Examples use bind_front_handler
* Add experimental test/handler.hpp * Add experimental test/handler.hpp
* Rename to async_op_base::invoke_now
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -316,7 +316,7 @@ async_echo(
// The function `async_op_base::invoke` takes care of calling // The function `async_op_base::invoke` takes care of calling
// the final completion handler. // the final completion handler.
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -284,7 +284,7 @@ public:
} }
} }
upcall: upcall:
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
} }
}; };

View File

@ -119,7 +119,7 @@ namespace beast {
} }
// Call the completion handler with the result // Call the completion handler with the result
this->invoke(ec, total_bytes_transferred_); this->invoke_now(ec, total_bytes_transferred_);
} }
}; };
@ -326,7 +326,7 @@ public:
*/ */
template<class... Args> template<class... Args>
void void
invoke(Args&&... args) invoke_now(Args&&... args)
{ {
this->before_invoke_hook(); this->before_invoke_hook();
wg1_.reset(); wg1_.reset();
@ -522,7 +522,7 @@ public:
} }
// The base class destroys the temporary data automatically, before invoking the final completion handler // The base class destroys the temporary data automatically, before invoking the final completion handler
this->invoke(ec); this->invoke_now(ec);
} }
}; };

View File

@ -96,7 +96,7 @@ public:
beast::bind_front_handler( beast::bind_front_handler(
std::move(*this), ec, total_)); std::move(*this), ec, total_));
} }
this->invoke(ec, total_); this->invoke_now(ec, total_);
} }
} }
}; };
@ -204,7 +204,7 @@ public:
beast::bind_front_handler( beast::bind_front_handler(
std::move(*this), ec, total_)); std::move(*this), ec, total_));
} }
this->invoke(ec, total_); this->invoke_now(ec, total_);
} }
} }

View File

@ -273,7 +273,7 @@ public:
upcall: upcall:
pg_.reset(); pg_.reset();
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
} }
}; };
@ -416,7 +416,7 @@ public:
pg0_.reset(); pg0_.reset();
pg1_.reset(); pg1_.reset();
this->invoke(ec, std::forward<Args>(args)...); this->invoke_now(ec, std::forward<Args>(args)...);
} }
}; };

View File

@ -95,7 +95,7 @@ public:
s_.buffer_.consume(bytes_transferred); s_.buffer_.consume(bytes_transferred);
break; break;
} }
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };

View File

@ -68,7 +68,7 @@ public:
boost::system::error_code ec, boost::system::error_code ec,
std::size_t bytes_transferred) std::size_t bytes_transferred)
{ {
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };

View File

@ -432,7 +432,7 @@ public:
BOOST_ASSERT(sr_.is_done()); BOOST_ASSERT(sr_.is_done());
} }
} }
this->invoke(ec, bytes_transferred_); this->invoke_now(ec, bytes_transferred_);
} }
}; };

View File

@ -199,7 +199,7 @@ public:
{ {
if(! ec) if(! ec)
d_.m = d_.p.release(); d_.m = d_.p.release();
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };

View File

@ -117,7 +117,7 @@ public:
{ {
if(! ec) if(! ec)
sr_.consume(bytes_transferred); sr_.consume(bytes_transferred);
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };
@ -203,7 +203,7 @@ public:
break; break;
} }
upcall: upcall:
this->invoke(ec, bytes_transferred_); this->invoke_now(ec, bytes_transferred_);
} }
} }
}; };
@ -249,7 +249,7 @@ public:
operator()( operator()(
error_code ec, std::size_t bytes_transferred) error_code ec, std::size_t bytes_transferred)
{ {
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };

View File

@ -83,7 +83,7 @@ public:
ws_.impl_->do_pmd_config(res_); ws_.impl_->do_pmd_config(res_);
ws_.impl_->open(role_type::server); ws_.impl_->open(role_type::server);
} }
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };
@ -176,7 +176,7 @@ public:
#endif #endif
} }
} }
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -253,7 +253,7 @@ public:
d_.ws.get_executor(), d_.ws.get_executor(),
beast::bind_front_handler(std::move(*this), ec)); beast::bind_front_handler(std::move(*this), ec));
} }
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -112,7 +112,7 @@ public:
if(d_.res_p) if(d_.res_p)
swap(d_.res, *d_.res_p); swap(d_.res, *d_.res_p);
upcall: upcall:
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -125,7 +125,7 @@ public:
d_.ws.impl_->paused_close.maybe_invoke() || d_.ws.impl_->paused_close.maybe_invoke() ||
d_.ws.impl_->paused_rd.maybe_invoke() || d_.ws.impl_->paused_rd.maybe_invoke() ||
d_.ws.impl_->paused_wr.maybe_invoke(); d_.ws.impl_->paused_wr.maybe_invoke();
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -617,7 +617,7 @@ public:
beast::bind_front_handler(std::move(*this), beast::bind_front_handler(std::move(*this),
ec, bytes_written_)); ec, bytes_written_));
} }
this->invoke(ec, bytes_written_); this->invoke_now(ec, bytes_written_);
} }
} }
}; };
@ -690,7 +690,7 @@ public:
} }
while(! some_ && ! ws_.is_message_done()); while(! some_ && ! ws_.is_message_done());
upcall: upcall:
this->invoke(ec, bytes_written_); this->invoke_now(ec, bytes_written_);
} }
} }
}; };

View File

@ -114,7 +114,7 @@ public:
error_code ignored; error_code ignored;
s_.non_blocking(nb_, ignored); s_.non_blocking(nb_, ignored);
} }
this->invoke(ec); this->invoke_now(ec);
} }
} }
}; };

View File

@ -431,7 +431,7 @@ operator()(
std::move(*this), std::move(*this),
ec, bytes_transferred_)); ec, bytes_transferred_));
} }
this->invoke(ec, bytes_transferred_); this->invoke_now(ec, bytes_transferred_);
} }
} }

View File

@ -594,7 +594,7 @@ public:
} }
// Call the completion handler with the result // Call the completion handler with the result
this->invoke(ec, total_bytes_transferred_); this->invoke_now(ec, total_bytes_transferred_);
} }
}; };
@ -681,7 +681,7 @@ public:
} }
// The base class destroys the temporary data automatically, before invoking the final completion handler // The base class destroys the temporary data automatically, before invoking the final completion handler
this->invoke(ec); this->invoke_now(ec);
} }
}; };

View File

@ -179,7 +179,7 @@ public:
void operator()(error_code ec, std::size_t bytes_transferred) void operator()(error_code ec, std::size_t bytes_transferred)
{ {
stream_.bytes_read_ += bytes_transferred; stream_.bytes_read_ += bytes_transferred;
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };
net::async_completion<ReadHandler, void(error_code, std::size_t)> init{handler}; net::async_completion<ReadHandler, void(error_code, std::size_t)> init{handler};
@ -214,7 +214,7 @@ public:
void operator()(error_code ec, std::size_t bytes_transferred) void operator()(error_code ec, std::size_t bytes_transferred)
{ {
stream_.bytes_written_ += bytes_transferred; stream_.bytes_written_ += bytes_transferred;
this->invoke(ec, bytes_transferred); this->invoke_now(ec, bytes_transferred);
} }
}; };
net::async_completion<WriteHandler, void(error_code, std::size_t)> init{handler}; net::async_completion<WriteHandler, void(error_code, std::size_t)> init{handler};