proxygen
inline_executor_flow_single< CancellationFactory > Struct Template Reference

Public Types

using properties = mi::property_set< mi::is_sender<>, mi::is_flow<>, mi::is_fifo_sequence<>, mi::is_maybe_blocking<>, mi::is_single<>>
 

Public Member Functions

auto executor ()
 
template<class Out >
void submit (Out out)
 

Public Attributes

CancellationFactory cf
 

Detailed Description

template<class CancellationFactory>
struct inline_executor_flow_single< CancellationFactory >

Definition at line 118 of file PushmiBenchmarks.cpp.

Member Typedef Documentation

template<class CancellationFactory >
using inline_executor_flow_single< CancellationFactory >::properties = mi::property_set< mi::is_sender<>, mi::is_flow<>, mi::is_fifo_sequence<>, mi::is_maybe_blocking<>, mi::is_single<>>

Definition at line 126 of file PushmiBenchmarks.cpp.

Member Function Documentation

template<class CancellationFactory >
auto inline_executor_flow_single< CancellationFactory >::executor ( )
inline

Definition at line 127 of file PushmiBenchmarks.cpp.

127  {
128  return inline_time_executor{};
129  }
template<class CancellationFactory >
template<class Out >
void inline_executor_flow_single< CancellationFactory >::submit ( Out  out)
inline

Definition at line 131 of file PushmiBenchmarks.cpp.

References folly::data(), folly::pushmi::lock_both(), MAKE, folly::gen::move, folly::pushmi::__adl::noexcept(), folly::pushmi::set_done, folly::pushmi::set_starting, folly::pushmi::set_value, and tokens.

131  {
132  auto tokens = cf();
133 
134  using Stopper = decltype(tokens.second);
135  struct Data : mi::receiver<> {
136  explicit Data(Stopper stopper) : stopper(std::move(stopper)) {}
137  Stopper stopper;
138  };
139  auto up = mi::MAKE(receiver)(
140  Data{std::move(tokens.second)},
141  [](auto& data) {},
142  [](auto& data, auto e) noexcept {
143  auto both = lock_both(data.stopper);
144  (*(both.first))(both.second);
145  },
146  [](auto& data) {
147  auto both = lock_both(data.stopper);
148  (*(both.first))(both.second);
149  });
150 
151  // pass reference for cancellation.
152  ::mi::set_starting(out, std::move(up));
153 
154  auto both = lock_both(tokens.first);
155  if (!!both.first && !*(both.first)) {
156  ::mi::set_value(out, *this);
157  } else {
158  // cancellation is not an error
159  ::mi::set_done(out);
160  }
161  }
locked_entangled_pair< T, Dual > lock_both(entangled< T, Dual > &e)
Definition: entangle.h:257
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
STL namespace.
requires E e noexcept(noexcept(s.error(std::move(e))))
#define MAKE(x)
Definition: pool.h:29
PUSHMI_INLINE_VAR constexpr __adl::set_starting_fn set_starting
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43
static const char tokens[256]
Definition: http_parser.c:184
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done

Member Data Documentation

template<class CancellationFactory >
CancellationFactory inline_executor_flow_single< CancellationFactory >::cf

Definition at line 119 of file PushmiBenchmarks.cpp.


The documentation for this struct was generated from the following file: