The default Timekeeper implementation which uses a HHWheelTimer on an EventBase in a dedicated thread. Users needn't deal with this directly, it is used by default by Future methods that work with timeouts.

Synopsis

Declared in <folly/futures/ThreadWheelTimekeeper.h>

class ThreadWheelTimekeeper
    : public EventBaseThreadTimekeeper

Base Classes

Name

Description

EventBaseThreadTimekeeper

A Timekeeper that schedules timeouts on an externally supplied EventBase.

Member Functions

Name

Description

ThreadWheelTimekeeper [constructor]

But it doesn't have to be a singleton.

~ThreadWheelTimekeeper [destructor] [virtual]

Destroys the timekeeper and stops its EventBase thread.

after [virtual]

Implement the Timekeeper interface

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 Data Members

Name

Description

eventBaseRef_

The EventBase used to schedule timeouts.

eventBase_

The EventBase driving the wheel timer.

thread_

The dedicated thread running the EventBase loop.

Created with MrDocs