26 #ifdef SPLICE_F_NONBLOCK 31 FileRegion(
int fd, loff_t offset,
size_t count)
32 : fd_(fd),
offset_(offset), count_(count) {}
35 std::shared_ptr<folly::AsyncTransport> transport) {
40 auto f = cb->promise_.getFuture();
41 auto req =
new FileWriteRequest(
socket.get(), cb, fd_,
offset_, count_);
48 void writeSuccess()
noexcept override {
53 void writeErr(
size_t ,
60 friend class FileRegion;
72 int fd, loff_t offset,
size_t count);
78 void consume()
override;
80 bool isComplete()
override;
84 void start() override;
86 class FileReadHandler : public
folly::EventHandler {
88 FileReadHandler(FileWriteRequest* req,
int pipe_in,
size_t bytesToRead);
90 ~FileReadHandler()
override;
95 FileWriteRequest* req_;
101 ~FileWriteRequest()
override;
108 bool started_{
false};
111 size_t bytesInPipe_{0};
114 std::unique_ptr<FileReadHandler> readHandler_;
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
NetworkSocket socket(int af, int type, int protocol)