Commit 9ff27587 authored by Sven Over's avatar Sven Over Committed by Facebook Github Bot 6

use folly::Function<void()> in folly::Executor interface

Summary:
This diff changes the definition of `folly::Func` from `std::function<void()>`
over to `folly::Function<void()>`. This mostly affects the interface of
`folly::Executor` and derived and related classes. By using
`folly::Function<void()>`, we allow to have lambdas capturing move-only types
passed to executors. This continues an effort to get rid of the potentially
dangerous `folly::MoveWrapper` by allowing to capture move-only types in lambdas
when using `folly::Future`, `folly::EventBase` and now `folly::Executor`.

Reviewed By: yfeldblum

Differential Revision: D3706449

fbshipit-source-id: 11c2cee32cb9f0298c39b7b1695a477777eeb3aa
parent 6a5f4337
......@@ -21,9 +21,11 @@
#include <functional>
#include <stdexcept>
#include <folly/Function.h>
namespace folly {
typedef std::function<void()> Func;
using Func = Function<void()>;
/// An Executor accepts units of work with add(), which should be
/// threadsafe.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment