<commit_before># @title Coro

# Introduction

[folly::coro](https://github.com/facebook/folly/blob/master/folly/experimental/coro/) is a developer-friendly asynchronous C++ framework based on [Coroutines TS](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4775.pdf). It is available for any fbcode project that is built with Сlang and uses platform007.

## Basic example

```c++
folly::coro::Task<int> task42() {
  co_return 42;
}

folly::coro::Task<int> taskSlow43() {
  co_await folly::futures::sleep(std::chrono::seconds{1});
  co_return co_await task42() + 1;
}

int main() {
  ...
  CHECK_EQ(
      43,
      folly::coro::blockingWait(taskSlow43().scheduleOn(folly::getCPUExecutor().get())));
  ...
}
```
The same logic implemented with folly::SemiFuture:

```c++
folly::SemiFuture<int> task42() {
  return folly::makeSemiFuture().deferValue([](auto) {
    return 42;
  });
}

folly::SemiFuture<int> taskSlow43() {
  return folly::futures::sleep(std::chrono::seconds{1})
      .semi()
      .deferValue([](auto) { return task42(); })<commit_msg>Update folly::experimental::coro docs to account for getCPUExecutor deprecation<commit_after># @title Coro

# Introduction

[folly::coro](https://github.com/facebook/folly/blob/master/folly/experimental/coro/) is a developer-friendly asynchronous C++ framework based on [Coroutines TS](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4775.pdf). It is available for any fbcode project that is built with Сlang and uses platform007.

## Basic example

```c++
folly::coro::Task<int> task42() {
  co_return 42;
}

folly::coro::Task<int> taskSlow43() {
  co_await folly::futures::sleep(std::chrono::seconds{1});
  co_return co_await task42() + 1;
}

int main() {
  ...
  CHECK_EQ(43, folly::coro::blockingWait(taskSlow43().scheduleOn(
                   folly::getGlobalCPUExecutor().get())));
  ...
}
```
The same logic implemented with folly::SemiFuture:

```c++
folly::SemiFuture<int> task42() {
  return folly::makeSemiFuture().deferValue([](auto) {
    return 42;
  });
}

folly::SemiFuture<int> taskSlow43() {
  return folly::futures::sleep(std::chrono::seconds{1})
      .semi()
      .deferValue([](auto) { return task42(); })
{'fraction_non_alphanumeric': 0.17660446062812926, 'fraction_numerical': 0.03550295857988166, 'mean_word_length': 4.8302387267904505, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2866261', 'n_tokens_mistral': 850, 'n_tokens_neox': 777, 'n_words': 149}