diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:39 +0000 |
commit | 4f868db3675eeee5994edc4fe79a9a2583623747 (patch) | |
tree | 18bd7ddac41675c3331d7156c3782f1c59a44667 /lib/PublicInbox/DS.pm | |
parent | df5755b40b4ba1d6048042e18d8ea501755b9a02 (diff) | |
download | public-inbox-4f868db3675eeee5994edc4fe79a9a2583623747.tar.gz |
At least the subset of epoll we use. EPOLLET might be difficult to emulate if we end up using it.
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r-- | lib/PublicInbox/DS.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index d6ef0b8d..e3479e66 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -142,15 +142,17 @@ sub _InitPoller return if $DoneInit; $DoneInit = 1; - if (!PublicInbox::Syscall::epoll_defined()) { - $Epoll = eval { - require PublicInbox::DSKQXS; - PublicInbox::DSKQXS->import; - PublicInbox::DSKQXS->new; - }; - } else { + if (PublicInbox::Syscall::epoll_defined()) { $Epoll = epoll_create(); set_cloexec($Epoll) if (defined($Epoll) && $Epoll >= 0); + } else { + my $cls; + for (qw(DSKQXS DSPoll)) { + $cls = "PublicInbox::$_"; + last if eval "require $cls"; + } + $cls->import; + $Epoll = $cls->new; } *EventLoop = *EpollEventLoop; } |