Skip to content

Commit

Permalink
added links to godbolt (#20)
Browse files Browse the repository at this point in the history
fbshipit-source-id: 8e93ce30fd17d832bcc09ae3ea5e4cf6cbd887b2
  • Loading branch information
kirkshoop authored and facebook-github-bot committed Oct 17, 2018
1 parent 2690ee5 commit 807d6c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions folly/experimental/pushmi/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This library is counterpart to [P1055 - *A Modest Executor Proposal*](http://wg2

*pushmi* is a header-only library that uses git submodules for dependencies (`git clone --recursive`), uses CMake to build, requires compliant C++14 compiler to build and has dependencies on meta and catch2 and some other libraries for testing and examples.

[![godbolt](https://img.shields.io/badge/godbolt-master-brightgreen.svg?style=flat-square)](https://godbolt.org/g/zjiX5j)

*pushmi* is an implementation for prototyping how Futures, Executors can be defined with shared Concepts. These Concepts can be implemented over and over again to solve different problems and make different tradeoffs. User implementations of the Concepts are first-class citizens due to the attention to composition. Composition also enables each implementation of the Concepts to focus on one concern and then be composed to build more complex solutions.

## Callbacks
Expand Down Expand Up @@ -271,14 +273,16 @@ auto tsd1 = time_single_deferred<int, std::exception_ptr>{time_single_deferred{}
## put it all together with some algorithms
[![godbolt](https://img.shields.io/badge/godbolt-master-brightgreen.svg?style=flat-square)](https://godbolt.org/g/zjiX5j)
### Executor
```cpp
auto nt = new_thread();
nt | blocking_submit([](auto nt){
nt |
transform([](auto nt){ return 42; }) | submit_after(20ms, [](int){}) |
transform([](auto nt){ return "42"s; }) | submit_after(40ms, [](std::string){});
transform([](int fortyTwo){ return "42"s; }) | submit_after(40ms, [](std::string){});
});
```

Expand All @@ -289,11 +293,11 @@ auto fortyTwo = just(42) |
transform([](auto v){ return std::to_string(v); }) |
on(new_thread) |
via(new_thread) |
get<std::string>();
get<std::string>;

just(42) |
transform([](auto v){ return std::to_string(v); }) |
on(new_thread) |
via(new_thread) |
blocking_submit([](std::string>){});
blocking_submit([](std::string){});
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <pushmi/o/just.h>
#include <pushmi/o/tap.h>

// https://godbolt.org/g/rVLMTu

using namespace pushmi::aliases;

// three models of submission deferral
Expand Down

0 comments on commit 807d6c9

Please sign in to comment.