folly::FunctionScheduler: replace std::function w/ folly::Function
authorSven Over <over@fb.com>
Mon, 4 Apr 2016 09:32:10 +0000 (02:32 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Mon, 4 Apr 2016 09:35:18 +0000 (02:35 -0700)
commita92b878a9c9928214b15f2f5b49c31032e9fb772
treea7e2f4058f8b874fcd9246bc32704c32d7f23f0a
parentaafcc64b0aaf719d59cc8ce5c7849eb1a1879a1f
folly::FunctionScheduler: replace std::function w/ folly::Function

Summary:By using folly::Function instead of std::function to internally store
functions in FunctionScheduler, this diff allows users to pass
non-copyable lambdas to FunctionScheduler::addFunction.

All exisiting unit tests still pass. Also, passing std::function to
addFunction still works, as the std::function will be implicitly
converted (i.e. wrapped) in a folly::Function. However, this implies
a performance penalty.

Reviewed By: fugalh

Differential Revision: D3092944

fb-gh-sync-id: 1e8081e70d4717025f2eadbb6b6da173460d4373
fbshipit-source-id: 1e8081e70d4717025f2eadbb6b6da173460d4373
folly/experimental/FunctionScheduler.cpp
folly/experimental/FunctionScheduler.h