Manually controlled Timekeeper for unit testing.
Synopsis
Declared in <folly/futures/ManualTimekeeper.h>
class ManualTimekeeper
: public folly::Timekeeper
Description
We assume advance(), now(), and numScheduled() are called from only a single thread, while after() can safely be called from multiple threads.
Base Classes
Name |
Description |
|
Member Functions
Name |
Description |
|
Constructs a ManualTimekeeper with its clock at the epoch. |
Advance the timekeeper's clock to (now() + dur). All futures with target time points less than or equal to (now() + dur) are fulfilled after the call to advance() returns |
|
Advance the timekeeper's clock at least enough to release the next pending event. |
|
|
|
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. |
|
Returns a future that will complete at the requested time. |
|
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. |
|
Returns the current clock value in the timekeeper. This is advanced only when someone calls advance() |
|
Returns the number of futures that are pending and have not yet been fulfilled |
Created with MrDocs