Skip to content

Instantly share code, notes, and snippets.

@hkaiser
Created October 21, 2017 21:55
Show Gist options
  • Save hkaiser/930f2dcbd99fb3dfc35cc4e50aafe21b to your computer and use it in GitHub Desktop.
Save hkaiser/930f2dcbd99fb3dfc35cc4e50aafe21b to your computer and use it in GitHub Desktop.
#include <hpx/hpx_main.hpp>
#include <hpx/include/parallel_executors.hpp>
struct test_async_executor
{
typedef hpx::parallel::execution::parallel_execution_tag execution_category;
template <typename F, typename ... Ts>
static hpx::future<typename hpx::util::invoke_result<F, Ts...>::type>
async_execute(F && f, Ts &&... ts)
{
return hpx::async(hpx::launch::async, std::forward<F>(f),
std::forward<Ts>(ts)...);
}
};
namespace hpx { namespace parallel { namespace execution
{
template <>
struct is_two_way_executor<test_async_executor>
: std::true_type
{};
}}}
int main()
{
test_async_executor exec;
hpx::future<void> f = hpx::make_ready_future();
f.then(exec,
[](hpx::future<void> && f)
{
});
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment