proxygen
wangle::EventBaseHandler Class Reference

#include <EventBaseHandler.h>

Inheritance diagram for wangle::EventBaseHandler:
wangle::OutboundHandler< Win, Wout > wangle::HandlerBase< OutboundHandlerContext< Wout > >

Public Member Functions

folly::Future< folly::Unitwrite (Context *ctx, std::unique_ptr< folly::IOBuf > buf) override
 
folly::Future< folly::Unitclose (Context *ctx) override
 
- Public Member Functions inherited from wangle::OutboundHandler< Win, Wout >
 ~OutboundHandler () override=default
 
virtual folly::Future< folly::Unitwrite (Context *ctx, Win msg)=0
 
virtual folly::Future< folly::UnitwriteException (Context *ctx, folly::exception_wrapper e)
 
- Public Member Functions inherited from wangle::HandlerBase< OutboundHandlerContext< Wout > >
virtual ~HandlerBase ()=default
 
virtual void attachPipeline (OutboundHandlerContext< Wout > *)
 
virtual void detachPipeline (OutboundHandlerContext< Wout > *)
 
OutboundHandlerContext< Wout > * getContext ()
 

Additional Inherited Members

- Public Types inherited from wangle::OutboundHandler< Win, Wout >
typedef folly::Unit rin
 
typedef folly::Unit rout
 
typedef Win win
 
typedef Wout wout
 
typedef OutboundHandlerContext< Wout > Context
 
- Static Public Attributes inherited from wangle::OutboundHandler< Win, Wout >
static const HandlerDir dir = HandlerDir::OUT
 

Detailed Description

Definition at line 24 of file EventBaseHandler.h.

Member Function Documentation

folly::Future<folly::Unit> wangle::EventBaseHandler::close ( Context ctx)
inlineoverridevirtual

Reimplemented from wangle::OutboundHandler< Win, Wout >.

Definition at line 38 of file EventBaseHandler.h.

References wangle::OutboundHandlerContext< Out >::fireClose(), and wangle::OutboundHandlerContext< Out >::getTransport().

38  {
39  DCHECK(ctx->getTransport());
40  DCHECK(ctx->getTransport()->getEventBase());
42  ctx->getTransport()->getEventBase()->runImmediatelyOrRunInEventBaseThreadAndWait([&](){
43  retval = ctx->fireClose();
44  });
45  return retval;
46  }
folly::Future<folly::Unit> wangle::EventBaseHandler::write ( Context ctx,
std::unique_ptr< folly::IOBuf buf 
)
inlineoverride

Definition at line 26 of file EventBaseHandler.h.

References wangle::OutboundHandlerContext< Out >::fireWrite(), wangle::OutboundHandlerContext< Out >::getTransport(), and folly::gen::move.

28  {
30  DCHECK(ctx->getTransport());
31  DCHECK(ctx->getTransport()->getEventBase());
32  ctx->getTransport()->getEventBase()->runImmediatelyOrRunInEventBaseThreadAndWait([&](){
33  retval = ctx->fireWrite(std::move(buf));
34  });
35  return retval;
36  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

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