Simplify BackgroundThreads, move them to folly/experimental/ThreadedRepeatingFunctionRunner
Summary: - `FunctionScheduler` and `EventBase` are great for sharing one thread for many functions, but one-function-per-thread is messy. - Both of those implementations are complicated, but `FunctionThreads` is dead-simple. - I made it even simpler by eliminating the former `incrementalSleep` in favor of `std::future::wait_for`, which allows instant interruption without a tweakable param. h/t aru777 for suggesting `std::future` instead of `std::condition_variable`. Reviewed By: yfeldblum Differential Revision: D4742134 fbshipit-source-id: b520bbcd5f218b2276200ffe8926722ae8a8d6ca
Showing
Please register or sign in to comment