Commit 3e05ecc2 authored by Kirk Shoop's avatar Kirk Shoop Committed by Facebook Github Bot

Merging examples (#17)

fbshipit-source-id: 0e4317ea86a60c50408cf415972bd048596ac0b2
parent 39d4be19
......@@ -3,8 +3,8 @@
#include <cassert>
#include <iostream>
#include <defer.h>
#include <share.h>
#include <pushmi/o/defer.h>
#include <pushmi/o/share.h>
#include <pushmi/o/just.h>
#include <pushmi/o/tap.h>
......@@ -67,6 +67,3 @@ int main()
std::cout << "OK" << std::endl;
// OK
}
......@@ -5,7 +5,7 @@
#include <pool.h>
#include <request_via.h>
#include <pushmi/o/request_via.h>
#include <pushmi/o/tap.h>
#include <pushmi/o/transform.h>
......@@ -43,6 +43,3 @@ int main()
std::cout << "OK" << std::endl;
}
......@@ -10,6 +10,13 @@
#include <pushmi/executor.h>
#include <pushmi/trampoline.h>
#if __cpp_deduction_guides >= 201703
#define MAKE(x) x MAKE_
#define MAKE_(...) {__VA_ARGS__}
#else
#define MAKE(x) make_ ## x
#endif
namespace pushmi {
using std::experimental::static_thread_pool;
......@@ -38,7 +45,7 @@ public:
inline auto executor() {
auto exec = execution::require(p.executor(), execution::never_blocking, execution::oneway);
return make_time_single_deferred(__pool_submit<decltype(exec)>{exec});
return MAKE(time_single_deferred)(__pool_submit<decltype(exec)>{exec});
}
inline void stop() {p.stop();}
......
......@@ -13,12 +13,10 @@
#include <pool.h>
#include <request_via.h>
#include <share.h>
#include <pushmi/deferred.h>
#include <pushmi/single_deferred.h>
#include <pushmi/o/just.h>
#include <pushmi/o/via.h>
#include <pushmi/o/transform.h>
using namespace pushmi::aliases;
......@@ -103,4 +101,3 @@ int main()
std::cout << "OK" << std::endl;
}
......@@ -12,9 +12,6 @@
#include <pool.h>
#include <request_via.h>
#include <share.h>
#include <pushmi/deferred.h>
#include <pushmi/single_deferred.h>
#include <pushmi/o/transform.h>
......
......@@ -8625,6 +8625,8 @@ PUSHMI_INLINE_VAR constexpr detail::now_fn top{};
// LICENSE file in the root directory of this source tree.
//#include "../single_deferred.h"
//#include "submit.h"
//#include "extension_operators.h"
namespace pushmi {
......
......@@ -6,9 +6,16 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#include <pushmi/single.h>
#include <pushmi/o/submit.h>
#include <pushmi/o/extension_operators.h>
#include "../single.h"
#include "submit.h"
#include "extension_operators.h"
#if __cpp_deduction_guides >= 201703
#define MAKE(x) x MAKE_
#define MAKE_(...) {__VA_ARGS__}
#else
#define MAKE(x) make_ ## x
#endif
namespace pushmi {
......@@ -17,7 +24,7 @@ namespace operators {
PUSHMI_TEMPLATE(class F)
(requires Invocable<F>)
auto defer(F f) {
return make_single_deferred(
return MAKE(single_deferred)(
constrain(lazy::Receiver<_1>,
[f = std::move(f)](auto out) mutable {
auto sender = f();
......
......@@ -7,6 +7,8 @@
// LICENSE file in the root directory of this source tree.
#include "../single_deferred.h"
#include "submit.h"
#include "extension_operators.h"
namespace pushmi {
......
......@@ -6,10 +6,10 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#include <pushmi/single.h>
#include <pushmi/o/submit.h>
#include <pushmi/o/extension_operators.h>
#include <pushmi/o/via.h>
#include "../single.h"
#include "submit.h"
#include "extension_operators.h"
#include "via.h"
namespace pushmi {
......
......@@ -6,11 +6,11 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#include <pushmi/single.h>
#include <pushmi/o/submit.h>
#include <pushmi/o/extension_operators.h>
#include "../single.h"
#include "submit.h"
#include "extension_operators.h"
#include <subject.h>
#include "../subject.h"
namespace pushmi {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment