proxygen
wangle::MockBroadcastPool Class Reference

#include <Mocks.h>

Inheritance diagram for wangle::MockBroadcastPool:
wangle::BroadcastPool< int, std::string >

Public Member Functions

 MockBroadcastPool ()
 
 MOCK_METHOD1_T (mockGetHandler, folly::MoveWrapper< folly::Future< BroadcastHandler< int, std::string > * >>(const std::string &))
 
folly::Future< BroadcastHandler< int, std::string > * > getHandler (const std::string &routingData) override
 
- Public Member Functions inherited from wangle::BroadcastPool< int, std::string >
 BroadcastPool (std::shared_ptr< ServerPool< std::string, DefaultPipeline >> serverPool, std::shared_ptr< BroadcastPipelineFactory< int, std::string >> pipelineFactory, std::shared_ptr< BaseClientBootstrapFactory<>> clientFactory=std::make_shared< ClientBootstrapFactory >())
 
 BroadcastPool (const BroadcastPool &)=delete
 
 BroadcastPool (BroadcastPool &&)=default
 
virtual ~BroadcastPool ()
 
BroadcastPooloperator= (const BroadcastPool &)=delete
 
BroadcastPooloperator= (BroadcastPool &&)=default
 
bool isBroadcasting (const std::string &routingData)
 
virtual void deleteBroadcast (const std::string &routingData)
 

Detailed Description

Definition at line 81 of file Mocks.h.

Constructor & Destructor Documentation

wangle::MockBroadcastPool::MockBroadcastPool ( )
inline

Definition at line 83 of file Mocks.h.

References wangle::MockSubscriber< T, R >::MOCK_METHOD1_T(), and string.

84  : BroadcastPool<int, std::string>(
85  nullptr,
86  nullptr,
87  std::make_shared<ClientBootstrapFactory>()) {}

Member Function Documentation

folly::Future<BroadcastHandler<int, std::string>*> wangle::MockBroadcastPool::getHandler ( const std::string routingData)
inlineoverridevirtual

Gets the BroadcastHandler, or creates one if it doesn't exist already, for the given routingData.

If a broadcast is already available for the given routingData, returns the BroadcastHandler from the pipeline. If not, an upstream connection is created and stored along with a new broadcast pipeline for this routingData, and its BroadcastHandler is returned.

Caller should immediately subscribe to the returned BroadcastHandler to prevent it from being garbage collected. Note that to ensure that this works correctly, the returned future completes on an InlineExecutor such that .then will be called inline with satisfaction of the underlying promise.

Reimplemented from wangle::BroadcastPool< int, std::string >.

Definition at line 94 of file Mocks.h.

95  {
96  return mockGetHandler(routingData).move();
97  }
wangle::MockBroadcastPool::MOCK_METHOD1_T ( mockGetHandler  ,
folly::MoveWrapper< folly::Future< BroadcastHandler< int, std::string > * >>  const std::string & 
)

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