proxygen
BonkMultiplexClientDispatcher Class Reference
Inheritance diagram for BonkMultiplexClientDispatcher:
wangle::ClientDispatcherBase< SerializePipeline, Bonk, Xtruct > wangle::HandlerAdapter< Xtruct, Bonk > wangle::Service< Bonk, Xtruct > wangle::Handler< Xtruct, Xtruct, Bonk, Bonk > wangle::HandlerBase< HandlerContext< Xtruct, Bonk > >

Public Member Functions

void read (Context *, Xtruct in) override
 
Future< Xtruct > operator() (Bonk arg) override
 
Future< Unitclose () override
 
Future< Unitclose (Context *ctx) override
 
- Public Member Functions inherited from wangle::ClientDispatcherBase< SerializePipeline, Bonk, Xtruct >
 ~ClientDispatcherBase () override
 
void setPipeline (SerializePipeline *pipeline)
 
folly::Future< folly::Unitclose () override
 
folly::Future< folly::Unitclose (Context *ctx) override
 
- Public Member Functions inherited from wangle::HandlerAdapter< Xtruct, Bonk >
void read (Context *ctx, Xtructmsg) override
 
folly::Future< folly::Unitwrite (Context *ctx, Bonkmsg) override
 
- Public Member Functions inherited from wangle::Handler< Xtruct, Xtruct, Bonk, Bonk >
 ~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)
 
- Public Member Functions inherited from wangle::HandlerBase< HandlerContext< Xtruct, Bonk > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (HandlerContext< Xtruct, Bonk > *)
 
virtual void detachPipeline (HandlerContext< Xtruct, Bonk > *)
 
HandlerContext< Xtruct, Bonk > * getContext ()
 
- Public Member Functions inherited from wangle::Service< Bonk, Xtruct >
virtual ~Service ()=default
 
virtual bool isAvailable ()
 

Private Attributes

std::unordered_map< int32_t, Promise< Xtruct > > requests_
 

Additional Inherited Members

- Public Types inherited from wangle::ClientDispatcherBase< SerializePipeline, Bonk, Xtruct >
typedef HandlerAdapter< Xtruct, Bonk >::Context Context
 
- Public Types inherited from wangle::HandlerAdapter< Xtruct, Bonk >
typedef Handler< Xtruct, Xtruct, Bonk, Bonk >::Context Context
 
- Public Types inherited from wangle::Handler< Xtruct, Xtruct, Bonk, Bonk >
typedef Xtruct rin
 
typedef Xtruct rout
 
typedef Bonk win
 
typedef Bonk wout
 
typedef HandlerContext< Xtruct, Bonk > Context
 
- Static Public Attributes inherited from wangle::Handler< Xtruct, Xtruct, Bonk, Bonk >
static const HandlerDir dir
 
- Protected Attributes inherited from wangle::ClientDispatcherBase< SerializePipeline, Bonk, Xtruct >
SerializePipelinepipeline_
 

Detailed Description

Definition at line 60 of file RpcClient.cpp.

Member Function Documentation

Future<Unit> BonkMultiplexClientDispatcher::close ( )
inlineoverridevirtual

Reimplemented from wangle::Service< Bonk, Xtruct >.

Definition at line 84 of file RpcClient.cpp.

References folly::netops::close().

84  {
85  printf("Channel closed\n");
87  }
int close(NetworkSocket s)
Definition: NetOps.cpp:90
Future<Unit> BonkMultiplexClientDispatcher::close ( Context ctx)
inlineoverridevirtual

Reimplemented from wangle::Handler< Xtruct, Xtruct, Bonk, Bonk >.

Definition at line 89 of file RpcClient.cpp.

References folly::netops::close().

89  {
90  printf("Channel closed\n");
91  return ClientDispatcherBase::close(ctx);
92  }
int close(NetworkSocket s)
Definition: NetOps.cpp:90
Future<Xtruct> BonkMultiplexClientDispatcher::operator() ( Bonk  arg)
inlineoverridevirtual

Implements wangle::Service< Bonk, Xtruct >.

Definition at line 71 of file RpcClient.cpp.

References f.

71  {
72  auto& p = requests_[arg.type];
73  auto f = p.getFuture();
74  p.setInterruptHandler([arg, this](const folly::exception_wrapper&) {
75  this->requests_.erase(arg.type);
76  });
77  this->pipeline_->write(arg);
78 
79  return f;
80  }
auto f
std::enable_if<!std::is_same< T, folly::Unit >::value, folly::Future< folly::Unit > >::type write(W msg)
Definition: Pipeline-inl.h:235
std::unordered_map< int32_t, Promise< Xtruct > > requests_
Definition: RpcClient.cpp:95
void BonkMultiplexClientDispatcher::read ( Context ,
Xtruct  in 
)
inlineoverridevirtual

Implements wangle::Handler< Xtruct, Xtruct, Bonk, Bonk >.

Definition at line 63 of file RpcClient.cpp.

References folly::gen::move.

63  {
64  auto search = requests_.find(in.i32_thing);
65  CHECK(search != requests_.end());
66  auto p = std::move(search->second);
67  requests_.erase(in.i32_thing);
68  p.setValue(in);
69  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unordered_map< int32_t, Promise< Xtruct > > requests_
Definition: RpcClient.cpp:95

Member Data Documentation

std::unordered_map<int32_t, Promise<Xtruct> > BonkMultiplexClientDispatcher::requests_
private

Definition at line 95 of file RpcClient.cpp.


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