proxygen
wangle::ClientDispatcherBase< Pipeline, Req, Resp > Class Template Reference

#include <ClientDispatcher.h>

Inheritance diagram for wangle::ClientDispatcherBase< Pipeline, Req, Resp >:
wangle::HandlerAdapter< Resp, Req > wangle::Service< Req, Resp > wangle::Handler< Resp, Resp, Req, Req > wangle::HandlerBase< HandlerContext< Resp, Req > > wangle::PipelinedClientDispatcher< Pipeline, Req, Resp > wangle::SerialClientDispatcher< Pipeline, Req, Resp >

Public Types

typedef HandlerAdapter< Resp, Req >::Context Context
 
- Public Types inherited from wangle::HandlerAdapter< Resp, Req >
typedef Handler< Resp, Resp, Req, Req >::Context Context
 
- Public Types inherited from wangle::Handler< Resp, Resp, Req, Req >
typedef Resp rin
 
typedef Resp rout
 
typedef Req win
 
typedef Req wout
 
typedef HandlerContext< Resp, ReqContext
 

Public Member Functions

 ~ClientDispatcherBase () override
 
void setPipeline (Pipeline *pipeline)
 
folly::Future< folly::Unitclose () override
 
folly::Future< folly::Unitclose (Context *ctx) override
 
- Public Member Functions inherited from wangle::HandlerAdapter< Resp, Req >
void read (Context *ctx, Respmsg) override
 
folly::Future< folly::Unitwrite (Context *ctx, Reqmsg) override
 
- Public Member Functions inherited from wangle::Handler< Resp, Resp, Req, Req >
 ~Handler () override=default
 
virtual void readEOF (Context *ctx)
 
virtual void readException (Context *ctx, folly::exception_wrapper e)
 
virtual void transportActive (Context *ctx)
 
virtual void transportInactive (Context *ctx)
 
virtual folly::Future< folly::UnitwriteException (Context *ctx, folly::exception_wrapper e)
 
virtual folly::Future< folly::Unitclose (Context *ctx)
 
- Public Member Functions inherited from wangle::HandlerBase< HandlerContext< Resp, Req > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (HandlerContext< Resp, Req > *)
 
virtual void detachPipeline (HandlerContext< Resp, Req > *)
 
HandlerContext< Resp, Req > * getContext ()
 
- Public Member Functions inherited from wangle::Service< Req, Resp >
virtual folly::Future< Resp > operator() (Req request)=0
 
virtual ~Service ()=default
 
virtual bool isAvailable ()
 

Protected Attributes

Pipelinepipeline_ {nullptr}
 

Additional Inherited Members

- Static Public Attributes inherited from wangle::Handler< Resp, Resp, Req, Req >
static const HandlerDir dir
 

Detailed Description

template<typename Pipeline, typename Req, typename Resp = Req>
class wangle::ClientDispatcherBase< Pipeline, Req, Resp >

Definition at line 25 of file ClientDispatcher.h.

Member Typedef Documentation

template<typename Pipeline, typename Req, typename Resp = Req>
typedef HandlerAdapter<Resp, Req>::Context wangle::ClientDispatcherBase< Pipeline, Req, Resp >::Context

Definition at line 28 of file ClientDispatcher.h.

Constructor & Destructor Documentation

template<typename Pipeline, typename Req, typename Resp = Req>
wangle::ClientDispatcherBase< Pipeline, Req, Resp >::~ClientDispatcherBase ( )
inlineoverride

Definition at line 30 of file ClientDispatcher.h.

30  {
31  if (pipeline_) {
32  try {
33  pipeline_->remove(this).finalize();
34  } catch (const std::invalid_argument& e) {
35  // not in pipeline; this is fine
36  }
37  }
38  }
PipelineBase & remove(H *handler)
Definition: Pipeline-inl.h:103
virtual void finalize()=0

Member Function Documentation

template<typename Pipeline, typename Req, typename Resp = Req>
folly::Future<folly::Unit> wangle::ClientDispatcherBase< Pipeline, Req, Resp >::close ( )
inlineoverridevirtual

Reimplemented from wangle::Service< Req, Resp >.

Definition at line 51 of file ClientDispatcher.h.

51  {
53  }
HandlerContext< Resp, Req > * getContext()
Definition: Handler.h:34
virtual folly::Future< folly::Unit > close(Context *ctx)
Definition: Handler.h:79
template<typename Pipeline, typename Req, typename Resp = Req>
folly::Future<folly::Unit> wangle::ClientDispatcherBase< Pipeline, Req, Resp >::close ( Context ctx)
inlineoverride

Definition at line 55 of file ClientDispatcher.h.

55  {
57  }
virtual folly::Future< folly::Unit > close(Context *ctx)
Definition: Handler.h:79
template<typename Pipeline, typename Req, typename Resp = Req>
void wangle::ClientDispatcherBase< Pipeline, Req, Resp >::setPipeline ( Pipeline pipeline)
inline

Definition at line 40 of file ClientDispatcher.h.

40  {
41  try {
42  pipeline->template remove<ClientDispatcherBase>();
43  } catch (const std::invalid_argument& e) {
44  // no existing dispatcher; this is fine
45  }
46  pipeline_ = pipeline;
47  pipeline_->addBack(this);
49  }
PipelineBase & addBack(std::shared_ptr< H > handler)
Definition: Pipeline-inl.h:39
void finalize() override
Definition: Pipeline-inl.h:267

Member Data Documentation


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