proxygen
wangle::MockServerPool Class Reference

#include <Mocks.h>

Inheritance diagram for wangle::MockServerPool:
wangle::ServerPool< std::string >

Public Member Functions

 MockServerPool (std::shared_ptr< folly::SocketAddress > addr)
 
folly::Future< DefaultPipeline * > connect (BaseClientBootstrap< DefaultPipeline > *client, const std::string &) noexceptoverride
 
void failConnect ()
 
- Public Member Functions inherited from wangle::ServerPool< std::string >
virtual ~ServerPool ()
 

Private Attributes

std::shared_ptr< folly::SocketAddressaddr_
 
bool failConnect_ {false}
 

Detailed Description

Definition at line 62 of file Mocks.h.

Constructor & Destructor Documentation

wangle::MockServerPool::MockServerPool ( std::shared_ptr< folly::SocketAddress addr)
inlineexplicit

Definition at line 64 of file Mocks.h.

65  : ServerPool(), addr_(addr) {}
std::shared_ptr< folly::SocketAddress > addr_
Definition: Mocks.h:77
ThreadPoolListHook * addr

Member Function Documentation

folly::Future<DefaultPipeline*> wangle::MockServerPool::connect ( BaseClientBootstrap< DefaultPipeline > *  client,
const std::string routingData 
)
inlineoverridevirtualnoexcept

Kick off an upstream connect request given the BaseClientBootstrap when a broadcast is not available locally.

Implements wangle::ServerPool< std::string >.

Definition at line 67 of file Mocks.h.

References wangle::BaseClientBootstrap< P >::connect().

69  {
70  return failConnect_ ? folly::makeFuture<DefaultPipeline*>(std::exception())
71  : client->connect(*addr_);
72  }
std::shared_ptr< folly::SocketAddress > addr_
Definition: Mocks.h:77
virtual folly::Future< P * > connect(const folly::SocketAddress &address, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))=0
void wangle::MockServerPool::failConnect ( )
inline

Definition at line 74 of file Mocks.h.

74 { failConnect_ = true; }

Member Data Documentation

std::shared_ptr<folly::SocketAddress> wangle::MockServerPool::addr_
private

Definition at line 77 of file Mocks.h.

bool wangle::MockServerPool::failConnect_ {false}
private

Definition at line 78 of file Mocks.h.


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