A Timekeeper with a dedicated thread that manages the timeouts using a heap. Timeouts can be scheduled with microsecond resolution, though in practice the accuracy depends on the OS scheduler's ability to wake up the worker thread in a timely fashion.

Synopsis

Declared in <folly/futures/HeapTimekeeper.h>

class HeapTimekeeper
    : public Timekeeper

Base Classes

Name

Description

Timekeeper

Member Functions

Name

Description

HeapTimekeeper [constructor]

Constructs a HeapTimekeeper and starts its dedicated worker thread.

~HeapTimekeeper [destructor] [virtual]

Destroys the HeapTimekeeper and stops its worker thread.

after [virtual]

Schedules a timeout that completes after the given duration.

afterUnsafe

Unsafe version of after that returns an inline Future. Any work added to this future will run inline on the Timekeeper's thread. This can potentially cause problems with timing.

at

Returns a future that will complete at the requested time.

atUnsafe

Unsafe version of at that returns an inline Future. Any work added to this future will run inline on the Timekeeper's thread. This can potentially cause problems with timing.

Protected Member Functions

Name

Description

worker [virtual]

Runs the dedicated worker thread that processes scheduled timeouts.

Created with MrDocs