proxygen
new_thread.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 
20 
21 namespace folly {
22 namespace pushmi {
23 
24 // very poor perf example executor.
25 //
26 
28  using properties = property_set<
34 
36  return {};
37  }
38  PUSHMI_TEMPLATE(class Out)
39  (requires Receiver<Out>)
40  void submit(Out out) {
41  std::thread t{[out = std::move(out)]() mutable {
44  }};
45  // pass ownership of thread to out
46  t.detach();
47  }
48 };
49 
51  return {};
52 }
53 
54 } // namespace pushmi
55 } // namespace folly
requires Tuple && t
detail::delegator< E > trampoline()
Definition: trampoline.h:261
requires Receiver< Out > void submit(Out out)
Definition: new_thread.h:40
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
new_thread_executor executor()
Definition: new_thread.h:35
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
new_thread_executor new_thread()
Definition: new_thread.h:50
auto tr
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