My Project: dht::Scheduler Class Reference

My Project 3.7.7 C++ Distributed Hash Table

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
dht::Scheduler Class Reference

Job scheduler. More...

`#include <scheduler.h>`

## Classes
struct | Job

## Public Member Functions
Sp< Scheduler::Job > | add (time_point t, std::function< void()> &&job_func)
void | edit (Sp< Scheduler::Job > &job, time_point t)
bool | cancel (Sp< Scheduler::Job > &job)
time_point | run ()
time_point | getNextJobTime () const
const time_point & | time () const
time_point | syncTime ()
void | syncTime (const time_point &n)

## Detailed Description

Job scheduler.

Maintains the timings upon which to execute a job.

Definition at line 18 of file scheduler.h.

## Member Function Documentation

## ◆ add()

Sp< Scheduler::Job > dht::Scheduler::add | ( | time_point | t,
|  | std::function< void()> && | job_func )
| inline

Adds another job to the queue.

Parameters

  time | The time upon which the job shall be executed.
  job_func | The job function to execute.

Returns
  pointer to the newly scheduled job.

Definition at line 40 of file scheduler.h.

## ◆ cancel()

bool dht::Scheduler::cancel | ( | Sp< Scheduler::Job > & | job | ) |
| inline

Definition at line 65 of file scheduler.h.

## ◆ edit()

void dht::Scheduler::edit | ( | Sp< Scheduler::Job > & | job,
|  | time_point | t )
| inline

Reschedules a job.

Parameters

  job | The job to edit.
  t | The time at which the job shall be rescheduled.

Definition at line 54 of file scheduler.h.

## ◆ getNextJobTime()

time_point dht::Scheduler::getNextJobTime | ( |  | ) | const
| inline

Definition at line 106 of file scheduler.h.

## ◆ run()

time_point dht::Scheduler::run | ( |  | ) |
| inline

Runs the jobs to do up to now.

Returns
  The time for the next job to run.

Definition at line 85 of file scheduler.h.

## ◆ syncTime() [1/2]

time_point dht::Scheduler::syncTime | ( |  | ) |
| inline

Definition at line 113 of file scheduler.h.

## ◆ syncTime() [2/2]

void dht::Scheduler::syncTime | ( | const time_point & | n | ) |
| inline

Definition at line 114 of file scheduler.h.

## ◆ time()

const time_point & dht::Scheduler::time | ( |  | ) | const
| inline

Accessors for the common time reference used for synchronizing operations.

Definition at line 112 of file scheduler.h.

The documentation for this class was generated from the following file:

- /home/noptrix/ba/blackarch/packages/opendht-c/src/opendht/include/opendht/scheduler.h