rename auto_performer to performer

This commit is contained in:
2019-07-07 08:50:36 +07:00
parent 4b9dae2f38
commit 36518720d2
4 changed files with 11 additions and 11 deletions

View File

@@ -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();

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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