proxygen
inline.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
19 
20 namespace folly {
21 namespace pushmi {
22 
24  public:
25  using properties = property_set<
31 
32  std::ptrdiff_t top() {
33  return 0;
34  }
35  auto executor() {
36  return *this;
37  }
38  PUSHMI_TEMPLATE(class CV, class Out)
39  (requires Regular<CV>&& Receiver<Out>)void submit(CV, Out out) {
40  set_value(out, *this);
41  set_done(out);
42  }
43 };
44 
47  return {};
48  }
49 };
50 
52  return {};
53 }
54 
56  public:
57  using properties = property_set<
58  is_time<>,
63 
64  auto top() {
66  }
67  auto executor() {
68  return *this;
69  }
70  PUSHMI_TEMPLATE(class TP, class Out)
71  (requires Regular<TP>&& Receiver<Out>)void submit(TP tp, Out out) {
72  std::this_thread::sleep_until(tp);
73  set_value(out, *this);
74  set_done(out);
75  }
76 };
77 
78 struct inlineTimeEXF {
80  return {};
81  }
82 };
83 
85  return {};
86 }
87 
89  public:
90  using properties = property_set<
96 
97  auto executor() {
98  return *this;
99  }
100  PUSHMI_TEMPLATE(class Out)
101  (requires Receiver<Out>)void submit(Out out) {
102  set_value(out, *this);
103  set_done(out);
104  }
105 };
106 
107 struct inlineEXF {
109  return {};
110  }
111 };
112 
114  return {};
115 }
116 
117 } // namespace pushmi
118 } // namespace folly
requires Regular< TP > &&Receiver< Out > void submit(TP tp, Out out)
Definition: inline.h:71
inline_executor_t operator()()
Definition: inline.h:108
std::chrono::steady_clock::time_point now()
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
inline_constrained_executor_t inline_constrained_executor()
Definition: inline.h:51
requires Receiver< Out > void submit(Out out)
Definition: inline.h:101
requires requires(detail::apply_impl(std::declval< F >(), std::declval< Tuple >(), detail::tupidxs< Tuple >{}))) const expr decltype(auto) apply(F &&f
PUSHMI_TEMPLATE(class E=std::exception_ptr, class Wrapped)(requires Sender< detail
Definition: executor.h:102
PUSHMI_INLINE_VAR constexpr __adl::set_value_fn set_value
inline_executor_t inline_executor()
Definition: inline.h:113
inline_time_executor_t operator()()
Definition: inline.h:79
inline_time_executor_t inline_time_executor()
Definition: inline.h:84
requires Regular< CV > &&Receiver< Out > void submit(CV, Out out)
Definition: inline.h:39
inline_constrained_executor_t operator()()
Definition: inline.h:46
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done