19 #include <boost/variant.hpp> 43 class PipelineBase :
public std::enable_shared_from_this<PipelineBase> {
57 manager_->deletePipeline(
this);
61 void setTransport(std::shared_ptr<folly::AsyncTransport> transport) {
73 std::pair<uint64_t, uint64_t> getReadBufferSettings();
75 void setTransportInfo(std::shared_ptr<TransportInfo> tInfo);
76 std::shared_ptr<TransportInfo> getTransportInfo();
107 H* getHandler(
int i);
123 bool setOwner(H* handler);
125 virtual void finalize() = 0;
127 size_t numHandlers()
const;
130 template <
class Context>
131 void addContextFront(Context* ctx);
133 void detachHandlers();
135 std::vector<std::shared_ptr<PipelineContext>>
ctxs_;
144 template <
class Context>
145 PipelineBase& addHelper(std::shared_ptr<Context>&& ctx,
bool front);
148 PipelineBase& removeHelper(H* handler,
bool checkEqual);
150 typedef std::vector<std::shared_ptr<PipelineContext>>::iterator
156 std::pair<uint64_t, uint64_t> readBufferSettings_{2048, 2048};
169 template <
class R,
class W = folly::Unit>
172 using Ptr = std::shared_ptr<Pipeline>;
175 return std::shared_ptr<Pipeline>(
new Pipeline());
180 template <
class T = R>
184 template <
class T = R>
188 template <
class T = R>
192 template <
class T = R>
196 template <
class T = R>
200 template <
class T = W>
205 template <
class T = W>
210 template <
class T = W>
215 void finalize()
override;
222 bool isStatic_{
false};
243 template <
typename Pipeline>
247 std::shared_ptr<folly::AsyncTransportWrapper>) = 0;
250 std::shared_ptr<folly::AsyncUDPSocket> ,
275 std::tuple<folly::IOBuf*,
276 std::shared_ptr<folly::AsyncUDPSocket>,
std::vector< PipelineContext * > outCtxs_
std::shared_ptr< PipelineContext > owner_
void write(const T &in, folly::io::Appender &appender)
boost::variant< folly::IOBuf *, folly::AsyncTransportWrapper *, ConnInfo &, ConnEvent, std::tuple< folly::IOBuf *, std::shared_ptr< folly::AsyncUDPSocket >, folly::SocketAddress > > AcceptPipelineType
std::vector< std::shared_ptr< PipelineContext > > ctxs_
const TransportInfo & tinfo
PipelineManager * getPipelineManager()
std::shared_ptr< TransportInfo > transportInfo_
SecureTransportType secureType
—— Concurrent Priority Queue Implementation ——
void handler(int, siginfo_t *, void *)
std::conditional< Handler::dir==HandlerDir::BOTH, ContextImpl< Handler >, typename std::conditional< Handler::dir==HandlerDir::IN, InboundContextImpl< Handler >, OutboundContextImpl< Handler > >::type >::type type
size_t read(T &out, folly::io::Cursor &cursor)
virtual Pipeline::Ptr newPipeline(std::shared_ptr< folly::AsyncUDPSocket >, const folly::SocketAddress &)
std::shared_ptr< folly::AsyncTransport > getTransport()
static const char *const value
virtual void deletePipeline(PipelineBase *pipeline)=0
virtual void refreshTimeout()
const std::string & nextProtoName
virtual ~PipelineManager()=default
std::vector< PipelineContext * > inCtxs_
std::vector< std::shared_ptr< PipelineContext > >::iterator ContextIterator
const folly::SocketAddress * clientAddr
Pipeline< AcceptPipelineType > AcceptPipeline
AsyncFizzClient::UniquePtr transport_
folly::AsyncTransportWrapper * sock
std::shared_ptr< Pipeline > Ptr
std::shared_ptr< folly::AsyncTransport > transport_
void setPipelineManager(PipelineManager *manager)
int close(NetworkSocket s)
void setTransport(std::shared_ptr< folly::AsyncTransport > transport)