27 if (eventBase !=
nullptr) {
43 assert(
event_.ev_base !=
nullptr);
50 if (events ==
event_.ev_events &&
51 static_cast<bool>(
flags & EVLIST_INTERNAL) ==
internal) {
61 struct event_base* evb =
event_.ev_base;
68 event_base_set(evb, &
event_);
92 if (event_add(&
event_,
nullptr) < 0) {
93 LOG(ERROR) <<
"EventBase: failed to register event handler for fd " 111 assert(
event_.ev_base ==
nullptr);
127 struct event_base* evb =
event_.ev_base;
143 LOG(ERROR) << fn <<
" called on registered handler; aborting";
150 assert(fd == handler->
event_.ev_fd);
155 observer->
starting(reinterpret_cast<uintptr_t>(handler));
164 observer->stopped(reinterpret_cast<uintptr_t>(handler));
175 if (
event_.ev_res & EV_READ) {
bool registerImpl(uint16_t events, bool internal)
static void libeventCallback(libevent_fd_t fd, short events, void *arg)
void initHandler(EventBase *eventBase, int fd)
void setEventBase(EventBase *eventBase)
—— Concurrent Priority Queue Implementation ——
void attachEventBase(EventBase *eventBase)
virtual void handlerReady(uint16_t events) noexcept=0
auto event_ref_flags(struct event *ev) -> decltype(std::ref(ev->ev_flags))
void folly_event_set(event *e, int fd, short s, EventSetCallback f, void *arg)
void handler(int, siginfo_t *, void *)
void bumpHandlingTime() final
event_base * getLibeventBase() const
void dcheckIsInEventBaseThread() const
void changeHandlerFD(int fd)
fbstring errnoStr(int err)
virtual void starting(uintptr_t id) noexcept=0
EventHandler(EventBase *eventBase, int fd)
void ensureNotRegistered(const char *fn)
ExecutionObserver * getExecutionObserver()
bool isHandlerRegistered() const