Summary:
Later is now superfluous. Just hold a deactivated future (e.g. one returned by `Future::via`), and then activate (or destruct) it when you're ready.
ThreadGate has proven to be too rigid and too heavyweight to be really useful. And is superfluous now with `Future::via`. e.g.
f.via(east).then(a1).then(a2).via(west).then(b1).then(b2);
This is stage one of removing these: mark them deprecated.
Stage two will be for me to change all existing usages in our code to not use them.
Stage three will be to rip these out altogether.
Test Plan:
Everything still builds and works, but now with deprecation warnings.
fbconfig -r \
common/smc/cpp/tests \
folly/wangle \
langtech/audiens \
messaging/avscan \
messaging/maelstrom \
neteng/traffic_manager \
notifications/nudge/service \
tao/client \
zeus/datashuttle
fbmake runtests
Reviewed By: jsedgwick@fb.com
Subscribers: net-systems@, fugalh, exa, njormrod, folly-diffs@
FB internal diff:
D1626412
Tasks:
5409538
--- /dev/null
+/*
+ * Copyright 2014 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
+#define DEPRECATED __attribute__((deprecated))
#pragma once
+#include <folly/wangle/Deprecated.h>
#include <folly/wangle/Executor.h>
#include <folly/wangle/Future.h>
#include <folly/Optional.h>
* .then([=]Try<DiskResponse>&& t) { return sendClientResponse(t.value()); })
* .launch();
*/
+// DEPRECATED. Just use Future::via() to accomplish the same thing. If it's
+// not obvious how, feel free to reach out.
template <class T>
-class Later {
+class DEPRECATED Later {
public:
typedef T value_type;
#pragma once
#include <memory>
#include <folly/wangle/Future.h>
+#include <folly/wangle/Deprecated.h>
namespace folly { namespace wangle {
change the components of the ThreadGate which your client code is already
using.
*/
-class ThreadGate {
+// DEPRECATED. Just use Future::via() to accomplish the same thing. If it's
+// not obvious how, feel free to reach out.
+class DEPRECATED ThreadGate {
public:
virtual ~ThreadGate() {}