[Boost-bugs] [Boost C++ Libraries] #6679: [asio] request : repeat timer

Subject: [Boost-bugs] [Boost C++ Libraries] #6679: [asio] request : repeat timer
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-12 08:01:08


#6679: [asio] request : repeat timer
-------------------------------------------------------+--------------------
 Reporter: Akira Takahashi <faithandbrave@…> | Owner: chris_kohlhoff
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.49.0 | Severity: Cosmetic
 Keywords: |
-------------------------------------------------------+--------------------
 This ticket is feature request.
 I want repeat feature in deadline_timer/waitable_timer.
 Many libraries timer have repeat features.
 follow code is example.


 before:
 {{{
 void on_timer(error_code error, steady_timer& timer)
 {
     if (error)
         return;

     timer.expires_from_now(seconds(1));
     timer.async_wait(boost::bind(&on_timer, _1, boost::ref(timer)));
 }

 int main()
 {
     ...
     timer.expires_from_now(seconds(1));
     timer.async_wait(boost::bind(&on_timer, _1, boost::ref(timer)));
 }
 }}}

 after:
 {{{
 void on_timer(error_code error, steady_timer& timer)
 {
     if (error)
         return;

     // no boiler plate
 }

 int main()
 {
     ...
     timer.expires_from_now(seconds(1), steady_timer::repeat);
     timer.async_wait(boost::bind(&on_timer, _1, boost::ref(timer)));
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6679>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC