From 36518720d2d0e0ca7e11d059492ccce45ae50356 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 7 Jul 2019 08:50:36 +0700 Subject: [PATCH] rename auto_performer to performer --- README.md | 2 +- headers/curly.hpp/curly.hpp | 6 +++--- sources/curly.hpp/curly.cpp | 10 +++++----- untests/curly_tests.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0c5b396..78c0568 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ target_link_libraries(your_project_target curly.hpp) namespace net = curly_hpp; // creates and hold a separate thread for automatically update async requests -net::auto_performer performer; +net::performer performer; // also, you can update requests manually from your favorite thread net::perform(); diff --git a/headers/curly.hpp/curly.hpp b/headers/curly.hpp/curly.hpp index 1f9a8d4..505fb9c 100644 --- a/headers/curly.hpp/curly.hpp +++ b/headers/curly.hpp/curly.hpp @@ -306,10 +306,10 @@ namespace curly_hpp namespace curly_hpp { - class auto_performer final { + class performer final { public: - auto_performer(); - ~auto_performer() noexcept; + performer(); + ~performer() noexcept; time_ms_t wait_activity() const noexcept; void wait_activity(time_ms_t ms) noexcept; diff --git a/sources/curly.hpp/curly.cpp b/sources/curly.hpp/curly.cpp index 560501d..d294bc6 100644 --- a/sources/curly.hpp/curly.cpp +++ b/sources/curly.hpp/curly.cpp @@ -848,13 +848,13 @@ namespace curly_hpp // ----------------------------------------------------------------------------- // -// auto_performer +// performer // // ----------------------------------------------------------------------------- namespace curly_hpp { - auto_performer::auto_performer() { + performer::performer() { thread_ = std::thread([this](){ while ( !done_ ) { curly_hpp::perform(); @@ -863,18 +863,18 @@ namespace curly_hpp }); } - auto_performer::~auto_performer() noexcept { + performer::~performer() noexcept { done_.store(true); if ( thread_.joinable() ) { thread_.join(); } } - time_ms_t auto_performer::wait_activity() const noexcept { + time_ms_t performer::wait_activity() const noexcept { return wait_activity_; } - void auto_performer::wait_activity(time_ms_t ms) noexcept { + void performer::wait_activity(time_ms_t ms) noexcept { wait_activity_ = ms; } } diff --git a/untests/curly_tests.cpp b/untests/curly_tests.cpp index cdf9d7a..dc90b04 100644 --- a/untests/curly_tests.cpp +++ b/untests/curly_tests.cpp @@ -80,7 +80,7 @@ namespace } TEST_CASE("curly") { - net::auto_performer performer; + net::performer performer; performer.wait_activity(net::time_ms_t(10)); SECTION("wait") { @@ -642,7 +642,7 @@ TEST_CASE("curly") { } TEST_CASE("curly_examples") { - net::auto_performer performer; + net::performer performer; SECTION("Get Requests") { // makes a GET request and async send it