proxygen
folly::pushmi::operators::flow_from_up< Producer > Struct Template Reference

#include <from.h>

Public Types

using properties = properties_t< receiver<>>
 

Public Member Functions

 flow_from_up (std::shared_ptr< Producer > p)
 
void value (std::ptrdiff_t requested)
 
template<class E >
void error (E) noexcept
 
void done ()
 

Public Attributes

std::shared_ptr< Producer > p
 

Detailed Description

template<class Producer>
struct folly::pushmi::operators::flow_from_up< Producer >

Definition at line 94 of file from.h.

Member Typedef Documentation

template<class Producer >
using folly::pushmi::operators::flow_from_up< Producer >::properties = properties_t<receiver<>>

Definition at line 95 of file from.h.

Constructor & Destructor Documentation

template<class Producer >
folly::pushmi::operators::flow_from_up< Producer >::flow_from_up ( std::shared_ptr< Producer >  p)
inlineexplicit

Definition at line 97 of file from.h.

97 : p(std::move(p)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::shared_ptr< Producer > p
Definition: from.h:98

Member Function Documentation

template<class Producer >
void folly::pushmi::operators::flow_from_up< Producer >::done ( )
inline

Definition at line 130 of file from.h.

References folly::pushmi::make_receiver, folly::pushmi::set_done, and submit.

130  {
131  p->stop.store(true);
133  p->exec, make_receiver([p = p](auto) { set_done(p->out); }));
134  }
std::shared_ptr< Producer > p
Definition: from.h:98
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done
template<class Producer >
template<class E >
void folly::pushmi::operators::flow_from_up< Producer >::error ( E  )
inlinenoexcept

Definition at line 124 of file from.h.

References folly::pushmi::make_receiver, folly::pushmi::set_done, and submit.

124  {
125  p->stop.store(true);
127  p->exec, make_receiver([p = p](auto) { set_done(p->out); }));
128  }
std::shared_ptr< Producer > p
Definition: from.h:98
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver
PUSHMI_INLINE_VAR constexpr __adl::set_done_fn set_done
template<class Producer >
void folly::pushmi::operators::flow_from_up< Producer >::value ( std::ptrdiff_t  requested)
inline

Definition at line 100 of file from.h.

References if(), folly::pushmi::make_receiver, and submit.

100  {
101  if (requested < 1) {
102  return;
103  }
104  // submit work to exec
106  p->exec, make_receiver([p = p, requested](auto) {
107  auto remaining = requested;
108  // this loop is structured to work when there is
109  // re-entrancy out.value in the loop may call up.value.
110  // to handle this the state of p->c must be captured and
111  // the remaining and p->c must be changed before
112  // out.value is called.
113  while (remaining-- > 0 && !p->stop && p->c != p->end) {
114  auto i = (p->c)++;
115  set_value(p->out, ::folly::pushmi::detail::as_const(*i));
116  }
117  if (p->c == p->end) {
118  set_done(p->out);
119  }
120  }));
121  }
std::shared_ptr< Producer > p
Definition: from.h:98
if(FOLLY_USE_SYMBOLIZER) add_library(folly_exception_tracer_base ExceptionTracer.cpp StackTrace.cpp) apply_folly_compile_options_to_target(folly_exception_tracer_base) target_link_libraries(folly_exception_tracer_base PUBLIC folly) add_library(folly_exception_tracer ExceptionStackTraceLib.cpp ExceptionTracerLib.cpp) apply_folly_compile_options_to_target(folly_exception_tracer) target_link_libraries(folly_exception_tracer PUBLIC folly_exception_tracer_base) add_library(folly_exception_counter ExceptionCounterLib.cpp) apply_folly_compile_options_to_target(folly_exception_counter) target_link_libraries(folly_exception_counter PUBLIC folly_exception_tracer) install(FILES ExceptionAbi.h ExceptionCounterLib.h ExceptionTracer.h ExceptionTracerLib.h StackTrace.h DESTINATION $
Definition: CMakeLists.txt:1
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::make_receiver_fn make_receiver

Member Data Documentation

template<class Producer >
std::shared_ptr<Producer> folly::pushmi::operators::flow_from_up< Producer >::p

Definition at line 98 of file from.h.


The documentation for this struct was generated from the following file: