Lines Matching refs:callback
28 std::function<bool()> callback; member
31 IOEvent(IOEventLoop* loop, const std::function<bool()>& callback) in IOEvent()
32 : loop(loop), e(nullptr), timeout({}), callback(callback), enabled(false) { in IOEvent()
97 if (!e->callback()) { in EventCallbackFn()
113 const std::function<bool()>& callback) { in AddReadEvent() argument
117 return AddEvent(fd, EV_READ | EV_PERSIST, nullptr, callback); in AddReadEvent()
121 const std::function<bool()>& callback) { in AddWriteEvent() argument
125 return AddEvent(fd, EV_WRITE | EV_PERSIST, nullptr, callback); in AddWriteEvent()
129 const std::function<bool()>& callback) { in AddSignalEvent() argument
130 return AddEvent(sig, EV_SIGNAL | EV_PERSIST, nullptr, callback) != nullptr; in AddSignalEvent()
134 const std::function<bool()>& callback) { in AddSignalEvents() argument
136 if (!AddSignalEvent(sig, callback)) { in AddSignalEvents()
143 IOEventRef IOEventLoop::AddPeriodicEvent(timeval duration, const std::function<bool()>& callback) { in AddPeriodicEvent() argument
144 return AddEvent(-1, EV_PERSIST, &duration, callback); in AddPeriodicEvent()
148 const std::function<bool()>& callback) { in AddEvent() argument
152 std::unique_ptr<IOEvent> e(new IOEvent(this, callback)); in AddEvent()