20 #include <system_error> 29 class AsyncSocketException;
39 unique_ptr<AsyncPipeReader, folly::DelayedDestruction::Destructor>
42 template <
typename...
Args>
100 unique_ptr<AsyncPipeWriter, folly::DelayedDestruction::Destructor>
103 template <
typename...
Args>
116 std::unique_ptr<folly::IOBuf> iob,
130 return (
fd_ < 0 || closeOnEmpty_);
148 return !queue_.empty();
164 throw std::runtime_error(
"writev is not supported. Please use writeChain.");
168 std::unique_ptr<folly::IOBuf>&& buf,
177 std::list<std::pair<folly::IOBufQueue, AsyncWriter::WriteCallback*>>
queue_;
178 bool closeOnEmpty_{
false};
void write(const T &in, folly::io::Appender &appender)
std::unique_ptr< AsyncPipeReader, folly::DelayedDestruction::Destructor > UniquePtr
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
static UniquePtr newReader(Args &&...args)
~AsyncPipeReader() override
AsyncPipeReader(folly::EventBase *eventBase, int pipeFd)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
~AsyncPipeWriter() override
std::list< std::pair< folly::IOBufQueue, AsyncWriter::WriteCallback * > > queue_
std::unique_ptr< AsyncPipeWriter, folly::DelayedDestruction::Destructor > UniquePtr
AsyncReader::ReadCallback * readCallback_
void writev(folly::AsyncWriter::WriteCallback *, const iovec *, size_t, WriteFlags=WriteFlags::NONE) override
void handlerReady(uint16_t events) noexceptoverride
void write(folly::AsyncWriter::WriteCallback *callback, const void *buf, size_t bytes, WriteFlags flags=WriteFlags::NONE) override
AsyncReader::ReadCallback * getReadCallback() const override
void setCloseCallback(std::function< void(int)> closeCb)
void setReadCB(AsyncReader::ReadCallback *callback) override
AsyncPipeWriter(folly::EventBase *eventBase, int pipeFd)
void setCloseCallback(std::function< void(int)> closeCb)
std::function< void(int)> closeCb_
void failRead(const AsyncSocketException &ex)
static UniquePtr newWriter(Args &&...args)
bool hasPendingWrites() const
bool registerHandler(uint16_t events)
bool isHandlerRegistered() const
std::function< void(int)> closeCb_