Commit Graph

7 Commits

Author SHA1 Message Date
Lee Howes
f28ef8281c [] Future<T>::then Future<T>::then(not-try-task) -> Future<T>::thenValue(task). - 2/11
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).

Reviewed By: Orvid

Differential Revision: D9696716

fbshipit-source-id: d71433c75af8422b2f16733c0b18a417d5a4cf2e
2018-09-07 11:07:25 -07:00
Lee Howes
69d8203162 Future<T>::then 6/n: Future<T>::then() & -> Future<T>::then() &&.
Summary:
Overall plan to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

6/n: Codemod rvalue-future<T>.then(...) to rvalue-future<T>.then(...).

Reviewed By: yfeldblum

Differential Revision: D9152002

fbshipit-source-id: 166475c1dcafb29a11154cbfbdf7e2e1feaf745b
2018-08-03 23:36:16 -07:00
Marshall Cline
9825a9fd3f modernize Future::get(): 4/n = codemod to std::move for non-ptr exprs
Summary:
Codemod non-pointer expressions:
   - expr.get() ==> std::move(expr).get()
   - expr.get(dur) ==> std::move(expr).get(dur)
when expr is not already an xvalue.

Reviewed By: yfeldblum

Differential Revision: D8429621

fbshipit-source-id: 87dea0749509d7083f14be93505ffff14ae8d464
2018-06-19 23:21:11 -07:00
Yedidya Feldblum
96af55472f CodeMod: future-then-continuation-lvalue-ref
Summary:
CodeMod: `future-then-continuation-lvalue-ref`.

```
buck run mode/opt foundation/clangr:clangr_coordinator -- run foundation/clang/codemods:future-then-continuation-lvalue-ref --dev -p 7 --num-workers=200
```

There is no need to support continuations taking non-const lvalue-ref params; callers can get exactly the same semantics with non-const rvalue-ref params instead. Thsi codemod preserves semantics. Many of these cases could do just as well taking by value, but this codemod preserves semantics.

Reviewed By: Orvid

Differential Revision: D8166008

fbshipit-source-id: 84b635cccce24b6485ffb5b24b98f10422b9a517
2018-05-30 12:32:16 -07:00
Orvid King
5e124cc05f Change calls from collectAll to collectAllSemiFuture
Summary: We are changing `folly::collectAll` to return `SemiFuture` rather than `Future` and this is needed as an interim step. After all calls to `collectAll` are changed to `collectAllSemiFuture`, we'll be renaming it back to `collectAll`.

Reviewed By: yfeldblum

Differential Revision: D8157548

fbshipit-source-id: 27b768ac7ff0d6572bde57f01601045a1fd5d5e5
2018-05-26 14:01:37 -07:00
Adam Simpkins
8e3c09a99a move folly/experimental/logging to folly/logging/
Summary:
Promote the folly logging code out of the experimental subdirectory.
We have been using this for several months in a few projects and are pretty
happy with it so far.

After moving it out of the experimental/ subdirectory I plan to update
folly::Init() to automatically support configuring it via a `--logging` command
line flag (similar to the initialization it already does today for glog).

Reviewed By: yfeldblum, chadaustin

Differential Revision: D7755455

fbshipit-source-id: 052db34c97f7516728f7cbb1a5ad959def2f6efb
2018-04-30 21:29:29 -07:00
Adam Simpkins
65a682a1ff add a function for diffing source control commits
Summary:
Add a function for diffing two source control commits without needing to
instantiate TreeInode objects.

Reviewed By: wez

Differential Revision: D7341604

fbshipit-source-id: 557eef87faa2785ab96d51b09569a46f892a71f6
2018-03-20 16:47:12 -07:00