proxygen
bulk.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 
23 namespace operators {
24 
25 PUSHMI_INLINE_VAR constexpr struct bulk_fn {
26  template <
27  class F,
28  class ShapeBegin,
29  class ShapeEnd,
30  class Target,
31  class IF,
32  class RS>
33  auto operator()(
34  F&& func,
35  ShapeBegin sb,
36  ShapeEnd se,
37  Target&& driver,
38  IF&& initFunc,
39  RS&& selector) const {
40  return [func, sb, se, driver, initFunc, selector](auto in) {
41  return make_single_sender(
42  [in, func, sb, se, driver, initFunc, selector](auto out) mutable {
43  submit(
44  in,
46  std::move(out),
47  [func, sb, se, driver, initFunc, selector](
48  auto& out, auto input) {
49  driver(
50  initFunc,
51  selector,
52  std::move(input),
53  func,
54  sb,
55  se,
56  std::move(out));
57  }));
58  });
59  };
60  }
61 } bulk{};
62 
63 } // namespace operators
64 
65 } // namespace pushmi
66 } // namespace folly
PUSHMI_INLINE_VAR constexpr detail::submit_fn submit
Definition: submit.h:386
auto operator()(F &&func, ShapeBegin sb, ShapeEnd se, Target &&driver, IF &&initFunc, RS &&selector) const
Definition: bulk.h:33
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
#define PUSHMI_INLINE_VAR
Definition: concept_def.h:60
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::bulk_fn bulk
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_single_sender_fn make_single_sender