From d53c91d0bc5108c14e9ab8c6726777dec2048843 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Thu, 1 Jun 2017 00:23:48 -0700 Subject: [PATCH] Remove FiberManagerFuture.h as it's dead Summary: All functions in this file are defined in `folly/fibers/FiberManager-inl.h`. There are no remaining references to this file. Reviewed By: yfeldblum Differential Revision: D5163160 fbshipit-source-id: 2fcb782a4de78f5c067610c876d0cf98f3b69e63 --- folly/fibers/FiberManagerFuture.h | 54 ------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 folly/fibers/FiberManagerFuture.h diff --git a/folly/fibers/FiberManagerFuture.h b/folly/fibers/FiberManagerFuture.h deleted file mode 100644 index df950652..00000000 --- a/folly/fibers/FiberManagerFuture.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2017 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#pragma once - -#include - -namespace folly { -namespace fibers { - -template -auto FiberManager::addTaskFuture(F&& func) -> folly::Future< - typename folly::Unit::Lift::type>::type> { - using T = typename std::result_of::type; - using FutureT = typename folly::Unit::Lift::type; - - folly::Promise p; - auto f = p.getFuture(); - addTaskFinally( - [func = std::forward(func)]() mutable { return func(); }, - [p = std::move(p)](folly::Try && t) mutable { - p.setTry(std::move(t)); - }); - return f; -} - -template -auto FiberManager::addTaskRemoteFuture(F&& func) -> folly::Future< - typename folly::Unit::Lift::type>::type> { - folly::Promise< - typename folly::Unit::Lift::type>::type> - p; - auto f = p.getFuture(); - addTaskRemote( - [ p = std::move(p), func = std::forward(func), this ]() mutable { - auto t = folly::makeTryWith(std::forward(func)); - runInMainContext([&]() { p.setTry(std::move(t)); }); - }); - return f; -} -} -} -- 2.34.1