proxygen
folly::python::test Namespace Reference

Functions

folly::Future< uint64_tfuture_getValueX5 (uint64_t val)
 
folly::Function< uint64_t()> getValueX5Fibers (uint64_t val)
 

Function Documentation

folly::Future<uint64_t> folly::python::test::future_getValueX5 ( uint64_t  val)

Definition at line 25 of file simple.h.

References f, folly::Promise< T >::getFuture(), and folly::Promise< T >::setWith().

25  {
27  auto f = p.getFuture();
28  p.setWith([val] {
29  if (val == 0) {
30  throw std::invalid_argument("0 is not allowed");
31  }
32  return val * 5;
33  });
34  return f;
35 }
auto f
void setWith(F &&func)
Definition: Promise-inl.h:137
double val
Definition: String.cpp:273
Future< T > getFuture()
Definition: Promise-inl.h:97
folly::Function<uint64_t()> folly::python::test::getValueX5Fibers ( uint64_t  val)

Definition at line 37 of file simple.h.

References val.

37  {
38  return [val]() {
39  if (val == 0) {
40  throw std::invalid_argument("0 is not allowed");
41  }
42  return val * 5;
43  };
44 }
double val
Definition: String.cpp:273