about summary refs log tree commit homepage
path: root/xt/mem-imapd-tls.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-01 09:54:41 +0000
committerEric Wong <e@80x24.org>2021-10-01 12:06:31 +0000
commit1c52f49354aa83e71fcceccae888da0c77f2391d (patch)
treebd6eabaed8cc0376e4a56cb6ec34cf962fd7ffdb /xt/mem-imapd-tls.t
parent5824d0d4ffac120a2840c980b4570868d6b3ea6b (diff)
downloadpublic-inbox-1c52f49354aa83e71fcceccae888da0c77f2391d.tar.gz
Since signalfd is often combined with our event loop, give it a
convenient API and reduce the code duplication required to use it.

EventLoop is replaced with ::event_loop to allow consistent
parameter passing and avoid needlessly passing the package name
on stack.

We also avoid exporting SFD_NONBLOCK since it's the only flag we
support.  There's no sense in having the memory overhead of a
constant function when it's in cold code.
Diffstat (limited to 'xt/mem-imapd-tls.t')
-rw-r--r--xt/mem-imapd-tls.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/xt/mem-imapd-tls.t b/xt/mem-imapd-tls.t
index bd75ef45..8992a6fc 100644
--- a/xt/mem-imapd-tls.t
+++ b/xt/mem-imapd-tls.t
@@ -95,7 +95,7 @@ foreach my $n (1..$nfd) {
 
         # one step through the event loop
         # do a little work as we connect:
-        PublicInbox::DS->EventLoop;
+        PublicInbox::DS::event_loop();
 
         # try not to overflow the listen() backlog:
         if (!($n % 128) && $DONE != $n) {
@@ -104,7 +104,7 @@ foreach my $n (1..$nfd) {
                 PublicInbox::DS->SetPostLoopCallback(sub { $DONE != $n });
 
                 # clear the backlog:
-                PublicInbox::DS->EventLoop;
+                PublicInbox::DS::event_loop();
 
                 # resume looping
                 PublicInbox::DS->SetLoopTimeout(0);
@@ -117,7 +117,7 @@ diag "done?: @".time." $DONE/$nfd";
 if ($DONE != $nfd) {
         PublicInbox::DS->SetLoopTimeout(-1);
         PublicInbox::DS->SetPostLoopCallback(sub { $DONE != $nfd });
-        PublicInbox::DS->EventLoop;
+        PublicInbox::DS::event_loop();
 }
 is($nfd, $DONE, "$nfd/$DONE done");
 if ($^O eq 'linux' && open(my $f, '<', "/proc/$pid/status")) {