Stormancer::IScheduler Class Referenceabstract

A scheduler used to schedule network tasks. More...

#include <IScheduler.h>

Public Types

using clock_type = std::chrono::steady_clock
 

Public Member Functions

virtual void schedulePeriodic (int delay, std::function< void()> work, pplx::cancellation_token ct=pplx::cancellation_token::none())=0
 
virtual void schedulePeriodic (int delay, std::function< void()> work, std::shared_ptr< IActionDispatcher > dispatcher, pplx::cancellation_token ct=pplx::cancellation_token::none())=0
 
virtual void schedule (clock_type::time_point when, std::function< void()> work, std::shared_ptr< IActionDispatcher > dispatcher=nullptr)=0
 

Detailed Description

A scheduler used to schedule network tasks.

Member Function Documentation

◆ schedule()

virtual void Stormancer::IScheduler::schedule ( clock_type::time_point  when,
std::function< void()>  work,
std::shared_ptr< IActionDispatcher dispatcher = nullptr 
)
pure virtual

Schedule a single-shot task at a given time point

Parameters
dispatcherThe dispatcher on which the work will be run. Leave it to nullptr to use the default dispatcher.

◆ schedulePeriodic() [1/2]

virtual void Stormancer::IScheduler::schedulePeriodic ( int  delay,
std::function< void()>  work,
pplx::cancellation_token  ct = pplx::cancellation_token::none() 
)
pure virtual

Schedule a cancellable periodic task on the scheculder

Parameters
delaymilliseconds

◆ schedulePeriodic() [2/2]

virtual void Stormancer::IScheduler::schedulePeriodic ( int  delay,
std::function< void()>  work,
std::shared_ptr< IActionDispatcher dispatcher,
pplx::cancellation_token  ct = pplx::cancellation_token::none() 
)
pure virtual

Schedule a cancellable periodic task on the scheculder

Parameters
delaymilliseconds

The documentation for this class was generated from the following file:
  • stormancer/stormancer-sources/include/public/stormancer/IScheduler.h