proxygen
wangle::ExecutorFilter< Req, Resp > Class Template Reference

#include <ExecutorFilter.h>

Inheritance diagram for wangle::ExecutorFilter< Req, Resp >:
wangle::ServiceFilter< Req, Resp > wangle::Service< Req, Resp >

Public Member Functions

 ExecutorFilter (std::shared_ptr< folly::Executor > exe, std::shared_ptr< Service< Req, Resp >> service)
 
folly::Future< Resp > operator() (Req req) override
 
- Public Member Functions inherited from wangle::ServiceFilter< Req, Resp >
 ServiceFilter (std::shared_ptr< Service< Req, Resp >> service)
 
 ~ServiceFilter () override=default
 
folly::Future< folly::Unitclose () override
 
bool isAvailable () override
 
- Public Member Functions inherited from wangle::Service< Req, Resp >
virtual ~Service ()=default
 

Private Attributes

std::shared_ptr< folly::Executorexe_
 

Additional Inherited Members

- Protected Attributes inherited from wangle::ServiceFilter< Req, Resp >
std::shared_ptr< Service< Req, Resp > > service_
 

Detailed Description

template<typename Req, typename Resp = Req>
class wangle::ExecutorFilter< Req, Resp >

A service that runs all requests through an executor.

Definition at line 27 of file ExecutorFilter.h.

Constructor & Destructor Documentation

template<typename Req, typename Resp = Req>
wangle::ExecutorFilter< Req, Resp >::ExecutorFilter ( std::shared_ptr< folly::Executor exe,
std::shared_ptr< Service< Req, Resp >>  service 
)
inlineexplicit

Definition at line 29 of file ExecutorFilter.h.

32  : ServiceFilter<Req, Resp>(service)
33  , exe_(exe) {}
std::shared_ptr< folly::Executor > exe_
InlineExecutor exe
Definition: Benchmark.cpp:337

Member Function Documentation

template<typename Req, typename Resp = Req>
folly::Future<Resp> wangle::ExecutorFilter< Req, Resp >::operator() ( Req  req)
inlineoverridevirtual

Implements wangle::Service< Req, Resp >.

Definition at line 35 of file ExecutorFilter.h.

35  {
36  return via(exe_.get()).thenValue(
37  [req = std::move(req), this](auto&&) mutable {
38  return (*this->service_)(std::move(req));
39  });
40  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
PUSHMI_INLINE_VAR constexpr detail::via_fn via
Definition: via.h:166
std::shared_ptr< Service< Req, Resp > > service_
Definition: Service.h:82
std::shared_ptr< folly::Executor > exe_

Member Data Documentation

template<typename Req, typename Resp = Req>
std::shared_ptr<folly::Executor> wangle::ExecutorFilter< Req, Resp >::exe_
private

Definition at line 43 of file ExecutorFilter.h.

Referenced by wangle::ExecutorFilter< Bonk, Xtruct >::operator()().


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