From: Hans Fugal Date: Mon, 20 Oct 2014 19:11:19 +0000 (-0700) Subject: (wangle) deprecate Later and ThreadGate X-Git-Tag: v0.22.0~256 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=72984487482d4e379d0b86198ae76a0de015141d (wangle) deprecate Later and ThreadGate 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 --- diff --git a/folly/wangle/Deprecated.h b/folly/wangle/Deprecated.h new file mode 100644 index 00000000..88d2f0f7 --- /dev/null +++ b/folly/wangle/Deprecated.h @@ -0,0 +1,18 @@ +/* + * 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)) diff --git a/folly/wangle/Later.h b/folly/wangle/Later.h index 94f2883c..329748e1 100644 --- a/folly/wangle/Later.h +++ b/folly/wangle/Later.h @@ -16,6 +16,7 @@ #pragma once +#include #include #include #include @@ -76,8 +77,10 @@ template struct isLater; * .then([=]Try&& 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 Later { +class DEPRECATED Later { public: typedef T value_type; diff --git a/folly/wangle/ThreadGate.h b/folly/wangle/ThreadGate.h index bed9d9aa..597fa6ab 100644 --- a/folly/wangle/ThreadGate.h +++ b/folly/wangle/ThreadGate.h @@ -17,6 +17,7 @@ #pragma once #include #include +#include namespace folly { namespace wangle { @@ -73,7 +74,9 @@ 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() {}