29 namespace submit_detail {
32 template(
class In,
class... AN)(
33 concept AutoSenderTo)(In, AN...),
37 template(
class In,
class... AN)(
38 concept AutoConstrainedSenderTo)(In, AN...),
42 template(
class In,
class... AN)(
43 concept AutoTimeSenderTo)(In, AN...),
53 template <
class... AN>
57 (
requires submit_detail::AutoSenderTo<In, AN...>)
58 In
operator()(In in) {
67 template <
class... AN>
69 return submit_fn::fn<AN...>{std::tuple<AN...>{(AN &&) an...}};
75 template <
class TP,
class... AN>
80 (
requires submit_detail::AutoTimeSenderTo<In, AN...>)
81 In
operator()(In in) {
92 auto operator()(TP at, AN... an)
const {
94 std::tuple<AN...>{(AN &&) an...}};
100 template <
class D,
class... AN>
105 (
requires submit_detail::AutoTimeSenderTo<In, AN...>)
106 In
operator()(In in) {
121 auto operator()(
D after, AN... an)
const {
123 std::tuple<AN...>{(AN &&) an...}};
131 std::atomic<int> nested{0};
141 : state_(state), ex_(
std::
move(ex)) {}
150 detail::is_v<Ex, test_for_this>)
156 not detail::is_v<Ex, test_for_this>)
174 (
requires Receiver<Out>&& Constrained<Exec>)
182 (
requires Receiver<Out> && not Constrained<Exec>)
200 std::exception_ptr e;
208 if (--state_->
nested == 0) {
213 std::exception_ptr e;
217 e = std::current_exception();
219 if (--state_->
nested == 0) {
223 std::rethrow_exception(e);
242 std::decay_t<Value>>>)
243 void operator()(Out out,
Value&&
v)
const {
246 if (--state_->
nested == 0) {
247 std::unique_lock<std::mutex>
guard{state_->
lock};
253 not(
sizeof...(VN) == 1 && And<
Executor<std::decay_t<VN>>...>))
254 void operator()(Out out, VN&&... vn)
const {
264 std::unique_lock<std::mutex>
guard{state_->
lock};
273 void operator()(Out out)
const {
275 std::unique_lock<std::mutex>
guard{state_->
lock};
287 std::tuple<AN...> args)
const {
288 return ::folly::pushmi::detail::receiver_from_fn<In>()(
298 (
requires Receiver<Out>&& SenderTo<In, Out>)
299 void operator()(In& in, Out out)
const {
306 template <
class... AN>
317 std::tuple<AN...>&&>> &&
318 not AlwaysBlocking<In>)
319 In
operator()(In in) {
322 auto make = receiver_impl<In>{};
323 auto submit = submit_impl<In>{};
326 std::unique_lock<std::mutex>
guard{state.
lock};
334 template <
class... AN>
345 template <
class... TN>
347 *result_ =
T{(TN &&) tn...};
354 *ep_ = std::make_exception_ptr(e);
365 T operator()(In in)
const {
370 using Out = decltype(out);
373 "'In' does not deliver value compatible with 'T' to 'Out'");
377 std::rethrow_exception(*ep_);
385 namespace operators {
PUSHMI_CONCEPT_DEF(template(class In, class...AN)(concept AutoSenderTo)(In, AN...), Sender< In > &&SenderTo< In, receiver_type_t< In, AN... >>)
std::atomic< int > nested
std::condition_variable signaled
void operator()(std::exception_ptr ep) const noexcept
std::tuple< AN... > args_
::folly::pushmi::detail::opt< std::exception_ptr > * ep_
properties_t< Exec > properties
std::remove_cv_t< std::remove_reference_t< T >> remove_cvref_t
typename receiver_from_fn< In >::template receiver_type< AN... > receiver_type_t
auto operator()(AN &&...an) const
std::enable_if_t< PropertySet< __properties_t< property_set_traits< T >>>, __properties_t< property_set_traits< T >>> properties_t
std::chrono::steady_clock::time_point now()
constexpr detail::Map< Move > move
std::tuple< AN... > args_
PUSHMI_INLINE_VAR constexpr __adl::set_error_fn set_error
—— Concurrent Priority Queue Implementation ——
nested_executor_impl(lock_state *state, Exec ex)
requires E e noexcept(noexcept(s.error(std::move(e))))
PUSHMI_INLINE_VAR constexpr __adl::get_executor_fn executor
nested_receiver_impl(lock_state *state, Out out)
requires Sender< Ex > &&Executor< Ex > &&static detail::is_v< Ex, test_for_this > auto make(lock_state *, Ex ex)
void error(E &&e) noexcept
PUSHMI_INLINE_VAR constexpr detail::blocking_submit_fn blocking_submit
requires Receiver< Out > &&Constrained< Exec > void submit(CV cv, Out out)
bool Value(const T &value, M matcher)
requires Sender< Ex > &&Executor< Ex > &¬ static detail::is_v< Ex, test_for_this > auto make(lock_state *state, Ex ex)
GuardImpl guard(ErrorHandler &&handler)
requires requires(::folly::pushmi::invoke(std::declval< F >(), std::get< Is >(std::declval< Tuple >())...))) const expr decltype(auto) apply_impl(F &&f
PUSHMI_INLINE_VAR constexpr detail::submit_at_fn submit_at
void operator()(TN &&...tn) const
void operator()(E e) const noexcept
auto operator()(AN...an) const
#define PUSHMI_INLINE_VAR
std::tuple< AN... > args_
properties_t< Out > properties
PUSHMI_INLINE_VAR constexpr __adl::get_top_fn top
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
std::tuple< AN... > args_
requires Constrained< Exec > auto top()
::folly::pushmi::detail::opt< T > * result_
PUSHMI_INLINE_VAR constexpr __adl::do_submit_fn submit
PUSHMI_TEMPLATE(class In, class Out, bool SenderRequires, bool SingleSenderRequires, bool TimeSingleSenderRequires)(requires Sender< In > &&Receiver< Out >) constexpr bool sender_requires_from()
decltype(folly::pushmi::invoke(std::declval< F >(), std::declval< As >()...)) invoke_result_t
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver
PUSHMI_INLINE_VAR constexpr detail::submit_after_fn submit_after
requires Receiver< Out > &¬ Constrained< Exec > void submit(Out out)
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done