29 virtual bool poll() = 0;
32 virtual bool pure_poll() = 0;
40 virtual bool try_enter_interrupt_mode() = 0;
41 virtual void exit_interrupt_mode() = 0;
47template <
bool Passive>
49 virtual bool pure_poll()
override final {
52 virtual bool try_enter_interrupt_mode()
override final {
55 virtual void exit_interrupt_mode()
override final {
61template <
typename Func>
62requires std::is_invocable_r_v<bool, Func>
64std::unique_ptr<seastar::pollfn> make_pollfn(Func&& func) {
66 the_pollfn(Func&& func) : func(
std::forward<Func>(func)) {}
68 virtual bool poll() override final {
72 return std::make_unique<the_pollfn>(std::forward<Func>(func));
76 std::unique_ptr<pollfn> _pollfn;
77 class registration_task;
78 class deregistration_task;
79 registration_task* _registration_task =
nullptr;
81 template <
typename Func>
82 requires std::is_invocable_r_v<bool, Func>
83 static poller simple(Func&& poll) {
84 return poller(make_pollfn(std::forward<Func>(poll)));
86 poller(std::unique_ptr<pollfn> fn)
87 : _pollfn(
std::move(fn)) {
91 poller(poller&& x)
noexcept;
92 poller& operator=(poller&& x)
noexcept;
93 void do_register() noexcept;
Seastar API namespace.
Definition: abort_on_ebadf.hh:26