From fdaf2ea7e1d33af10d2dc9ca068b0f3e6dc54ede Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 15 Feb 2019 15:02:38 -0800 Subject: [PATCH] Rename to async_op_base::invoke_now --- CHANGELOG.md | 1 + example/echo-op/echo_op.cpp | 2 +- include/boost/beast/_experimental/http/impl/icy_stream.hpp | 2 +- include/boost/beast/core/async_op_base.hpp | 6 +++--- include/boost/beast/core/detail/impl/read.hpp | 4 ++-- include/boost/beast/core/impl/basic_stream.hpp | 4 ++-- include/boost/beast/core/impl/buffered_read_stream.hpp | 2 +- include/boost/beast/core/impl/flat_stream.hpp | 2 +- include/boost/beast/http/impl/file_body_win32.ipp | 2 +- include/boost/beast/http/impl/read.ipp | 2 +- include/boost/beast/http/impl/write.ipp | 6 +++--- include/boost/beast/websocket/impl/accept.hpp | 4 ++-- include/boost/beast/websocket/impl/close.hpp | 2 +- include/boost/beast/websocket/impl/handshake.hpp | 2 +- include/boost/beast/websocket/impl/ping.hpp | 2 +- include/boost/beast/websocket/impl/read.hpp | 4 ++-- include/boost/beast/websocket/impl/teardown.hpp | 2 +- include/boost/beast/websocket/impl/write.hpp | 2 +- test/beast/core/async_op_base.cpp | 4 ++-- test/doc/core_3_layers.cpp | 4 ++-- 20 files changed, 30 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7ab6ae..8ece7708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Version 215: * bind_front_handler works with member functions * Examples use bind_front_handler * Add experimental test/handler.hpp +* Rename to async_op_base::invoke_now -------------------------------------------------------------------------------- diff --git a/example/echo-op/echo_op.cpp b/example/echo-op/echo_op.cpp index 6f13966e..802544b0 100644 --- a/example/echo-op/echo_op.cpp +++ b/example/echo-op/echo_op.cpp @@ -316,7 +316,7 @@ async_echo( // The function `async_op_base::invoke` takes care of calling // the final completion handler. - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/_experimental/http/impl/icy_stream.hpp b/include/boost/beast/_experimental/http/impl/icy_stream.hpp index 775a46a0..368c3ceb 100644 --- a/include/boost/beast/_experimental/http/impl/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/impl/icy_stream.hpp @@ -284,7 +284,7 @@ public: } } upcall: - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } } }; diff --git a/include/boost/beast/core/async_op_base.hpp b/include/boost/beast/core/async_op_base.hpp index 0a90a283..201445cc 100644 --- a/include/boost/beast/core/async_op_base.hpp +++ b/include/boost/beast/core/async_op_base.hpp @@ -119,7 +119,7 @@ namespace beast { } // 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 void - invoke(Args&&... args) + invoke_now(Args&&... args) { this->before_invoke_hook(); wg1_.reset(); @@ -522,7 +522,7 @@ public: } // The base class destroys the temporary data automatically, before invoking the final completion handler - this->invoke(ec); + this->invoke_now(ec); } }; diff --git a/include/boost/beast/core/detail/impl/read.hpp b/include/boost/beast/core/detail/impl/read.hpp index e6b0bb56..1933c9e5 100644 --- a/include/boost/beast/core/detail/impl/read.hpp +++ b/include/boost/beast/core/detail/impl/read.hpp @@ -96,7 +96,7 @@ public: beast::bind_front_handler( std::move(*this), ec, total_)); } - this->invoke(ec, total_); + this->invoke_now(ec, total_); } } }; @@ -204,7 +204,7 @@ public: beast::bind_front_handler( std::move(*this), ec, total_)); } - this->invoke(ec, total_); + this->invoke_now(ec, total_); } } diff --git a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp index 925f981e..097b20d5 100644 --- a/include/boost/beast/core/impl/basic_stream.hpp +++ b/include/boost/beast/core/impl/basic_stream.hpp @@ -273,7 +273,7 @@ public: upcall: pg_.reset(); - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } } }; @@ -416,7 +416,7 @@ public: pg0_.reset(); pg1_.reset(); - this->invoke(ec, std::forward(args)...); + this->invoke_now(ec, std::forward(args)...); } }; diff --git a/include/boost/beast/core/impl/buffered_read_stream.hpp b/include/boost/beast/core/impl/buffered_read_stream.hpp index 0f50f4e3..97c97b2f 100644 --- a/include/boost/beast/core/impl/buffered_read_stream.hpp +++ b/include/boost/beast/core/impl/buffered_read_stream.hpp @@ -95,7 +95,7 @@ public: s_.buffer_.consume(bytes_transferred); break; } - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/core/impl/flat_stream.hpp b/include/boost/beast/core/impl/flat_stream.hpp index e9868bfd..dcdee697 100644 --- a/include/boost/beast/core/impl/flat_stream.hpp +++ b/include/boost/beast/core/impl/flat_stream.hpp @@ -68,7 +68,7 @@ public: boost::system::error_code ec, std::size_t bytes_transferred) { - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/http/impl/file_body_win32.ipp b/include/boost/beast/http/impl/file_body_win32.ipp index cb3f8c79..06c8f60d 100644 --- a/include/boost/beast/http/impl/file_body_win32.ipp +++ b/include/boost/beast/http/impl/file_body_win32.ipp @@ -432,7 +432,7 @@ public: BOOST_ASSERT(sr_.is_done()); } } - this->invoke(ec, bytes_transferred_); + this->invoke_now(ec, bytes_transferred_); } }; diff --git a/include/boost/beast/http/impl/read.ipp b/include/boost/beast/http/impl/read.ipp index c81e0348..38058a6b 100644 --- a/include/boost/beast/http/impl/read.ipp +++ b/include/boost/beast/http/impl/read.ipp @@ -199,7 +199,7 @@ public: { if(! ec) d_.m = d_.p.release(); - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/http/impl/write.ipp b/include/boost/beast/http/impl/write.ipp index 1dd0a1cc..25a78206 100644 --- a/include/boost/beast/http/impl/write.ipp +++ b/include/boost/beast/http/impl/write.ipp @@ -117,7 +117,7 @@ public: { if(! ec) sr_.consume(bytes_transferred); - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; @@ -203,7 +203,7 @@ public: break; } upcall: - this->invoke(ec, bytes_transferred_); + this->invoke_now(ec, bytes_transferred_); } } }; @@ -249,7 +249,7 @@ public: operator()( error_code ec, std::size_t bytes_transferred) { - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index 0c123fd6..65828788 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -83,7 +83,7 @@ public: ws_.impl_->do_pmd_config(res_); ws_.impl_->open(role_type::server); } - this->invoke(ec); + this->invoke_now(ec); } } }; @@ -176,7 +176,7 @@ public: #endif } } - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/close.hpp b/include/boost/beast/websocket/impl/close.hpp index c40d27c0..dc5dfc64 100644 --- a/include/boost/beast/websocket/impl/close.hpp +++ b/include/boost/beast/websocket/impl/close.hpp @@ -253,7 +253,7 @@ public: d_.ws.get_executor(), beast::bind_front_handler(std::move(*this), ec)); } - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index 07481b79..cc6ff898 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -112,7 +112,7 @@ public: if(d_.res_p) swap(d_.res, *d_.res_p); upcall: - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/ping.hpp b/include/boost/beast/websocket/impl/ping.hpp index a160ed1a..42b8584d 100644 --- a/include/boost/beast/websocket/impl/ping.hpp +++ b/include/boost/beast/websocket/impl/ping.hpp @@ -125,7 +125,7 @@ public: d_.ws.impl_->paused_close.maybe_invoke() || d_.ws.impl_->paused_rd.maybe_invoke() || d_.ws.impl_->paused_wr.maybe_invoke(); - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/read.hpp b/include/boost/beast/websocket/impl/read.hpp index facc5981..2c08dadf 100644 --- a/include/boost/beast/websocket/impl/read.hpp +++ b/include/boost/beast/websocket/impl/read.hpp @@ -617,7 +617,7 @@ public: beast::bind_front_handler(std::move(*this), 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()); upcall: - this->invoke(ec, bytes_written_); + this->invoke_now(ec, bytes_written_); } } }; diff --git a/include/boost/beast/websocket/impl/teardown.hpp b/include/boost/beast/websocket/impl/teardown.hpp index 294516e8..6e87aef3 100644 --- a/include/boost/beast/websocket/impl/teardown.hpp +++ b/include/boost/beast/websocket/impl/teardown.hpp @@ -114,7 +114,7 @@ public: error_code ignored; s_.non_blocking(nb_, ignored); } - this->invoke(ec); + this->invoke_now(ec); } } }; diff --git a/include/boost/beast/websocket/impl/write.hpp b/include/boost/beast/websocket/impl/write.hpp index a5216393..88389c5b 100644 --- a/include/boost/beast/websocket/impl/write.hpp +++ b/include/boost/beast/websocket/impl/write.hpp @@ -431,7 +431,7 @@ operator()( std::move(*this), ec, bytes_transferred_)); } - this->invoke(ec, bytes_transferred_); + this->invoke_now(ec, bytes_transferred_); } } diff --git a/test/beast/core/async_op_base.cpp b/test/beast/core/async_op_base.cpp index 33eb1e47..9993dbb8 100644 --- a/test/beast/core/async_op_base.cpp +++ b/test/beast/core/async_op_base.cpp @@ -594,7 +594,7 @@ public: } // 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 - this->invoke(ec); + this->invoke_now(ec); } }; diff --git a/test/doc/core_3_layers.cpp b/test/doc/core_3_layers.cpp index b62c3d33..cc11a36e 100644 --- a/test/doc/core_3_layers.cpp +++ b/test/doc/core_3_layers.cpp @@ -179,7 +179,7 @@ public: void operator()(error_code ec, std::size_t bytes_transferred) { stream_.bytes_read_ += bytes_transferred; - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; net::async_completion init{handler}; @@ -214,7 +214,7 @@ public: void operator()(error_code ec, std::size_t bytes_transferred) { stream_.bytes_written_ += bytes_transferred; - this->invoke(ec, bytes_transferred); + this->invoke_now(ec, bytes_transferred); } }; net::async_completion init{handler};