Skip to content

Commit

Permalink
Use one-shot expirations instead of intervals for the libev backend
Browse files Browse the repository at this point in the history
  • Loading branch information
rwols committed Sep 6, 2021
1 parent cffbd34 commit b25c3f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/amqpcpp/libev.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class LibEvHandler : public TcpHandler
}

// reset the timer to trigger again later
_timer.repeat = std::min(_next, _expire) - now;
ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0);

// restart the timer
ev_timer_again(_loop, &_timer);
Expand Down Expand Up @@ -366,7 +366,7 @@ class LibEvHandler : public TcpHandler
_expire = now + _timeout * 1.5;

// find the earliest thing that expires
_timer.repeat = std::min(_next, _expire) - now;
ev_timer_set(&_timer, std::min(_next, _expire) - now, 0.0);

// restart the timer
ev_timer_again(_loop, &_timer);
Expand Down

0 comments on commit b25c3f3

Please sign in to comment.