proxygen
ThreadPrintingHandler Class Reference
Inheritance diagram for ThreadPrintingHandler:
wangle::HandlerAdapter< R, W > wangle::Handler< R, R, W, W > wangle::HandlerBase< HandlerContext< R, W > >

Public Member Functions

 ThreadPrintingHandler (const char &routingData)
 
void transportActive (Context *ctx) override
 
- Public Member Functions inherited from wangle::HandlerAdapter< R, W >
void read (Context *ctx, R msg) override
 
folly::Future< folly::Unitwrite (Context *ctx, W msg) override
 
- Public Member Functions inherited from wangle::Handler< R, R, W, W >
 ~Handler () override=default
 
virtual void read (Context *ctx, Rmsg)=0
 
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::Unitwrite (Context *ctx, Wmsg)=0
 
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< R, W > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (HandlerContext< R, W > *)
 
virtual void detachPipeline (HandlerContext< R, W > *)
 
HandlerContext< R, W > * getContext ()
 

Private Attributes

char routingData_
 

Additional Inherited Members

- Public Types inherited from wangle::HandlerAdapter< R, W >
typedef Handler< R, R, W, W >::Context Context
 
- Public Types inherited from wangle::Handler< R, R, W, W >
typedef R rin
 
typedef R rout
 
typedef W win
 
typedef W wout
 
typedef HandlerContext< R, W > Context
 
- Static Public Attributes inherited from wangle::Handler< R, R, W, W >
static const HandlerDir dir
 

Detailed Description

Definition at line 64 of file accept_steering_server.cpp.

Constructor & Destructor Documentation

ThreadPrintingHandler::ThreadPrintingHandler ( const char &  routingData)
inlineexplicit

Definition at line 66 of file accept_steering_server.cpp.

67  : routingData_(routingData) {}

Member Function Documentation

void ThreadPrintingHandler::transportActive ( Context ctx)
inlineoverride

Definition at line 69 of file accept_steering_server.cpp.

References folly::netops::close(), folly::IOBuf::copyBuffer(), and fizz::detail::write().

69  {
70  std::stringstream out;
71  out << "You were hashed to thread " << std::this_thread::get_id()
72  << " based on '" << routingData_ << "'" << std::endl;
73  write(ctx, IOBuf::copyBuffer(out.str()));
74  close(ctx);
75  }
folly::Future< folly::Unit > write(Context *ctx, W msg) override
Definition: Handler.h:167
virtual folly::Future< folly::Unit > close(Context *ctx)
Definition: Handler.h:79
std::unique_ptr< IOBuf > copyBuffer(const folly::IOBuf &buf)

Member Data Documentation

char ThreadPrintingHandler::routingData_
private

Definition at line 78 of file accept_steering_server.cpp.


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