Project

General

Profile

Actions

Task #1119

closed

Implement simple event scheduler

Added by Alex Afanasyev over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Immediate
Category:
Core
Target version:
Start date:
01/24/2014
Due date:
01/24/2014
% Done:

100%

Estimated time:
3.00 h

Description

Scheduler interface specification:

class Scheduler
{
public:
  typedef function<void()> Event;

  Scheduler(boost::asio::io_service& ioService);

  /**
   * \brief Schedule one time event after the specified delay
   * \returns EventId that can be used to cancel the scheduled event
   */
  EventId
  scheduleEvent(const time::Duration& after, const Event& event);

  /**
   * \brief Schedule periodic event that should be fired every specified period.
   *        First event will be fired after the specified delay.
   * \returns EventId that can be used to cancel the scheduled event
   */
  EventId
  schedulePeriodicEvent(const time::Duration& after,
                        const time::Duration& period,
                        const Event& event);

  /**
   * \brief Cancel scheduled event
   */
  void
  cancelEvent(const EventId& eventId);
};

Related issues 2 (0 open2 closed)

Related to ndn-cxx - Task #1152: time structsClosedAlex Afanasyev

Actions
Blocked by NFD - Task #1148: mock implementation of time structsClosedJunxiao Shi01/24/2014

Actions
Actions

Also available in: Atom PDF