]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTPD/Async.pm
ds: handle deferred DS->close after timers
[public-inbox.git] / lib / PublicInbox / HTTPD / Async.pm
index b46baeb2804f44a88244b35b7211fabda72da16a..35d171506cd52b3253456aca2728d4a68685b30b 100644 (file)
@@ -19,8 +19,8 @@ sub new {
        # no $io? call $cb at the top of the next event loop to
        # avoid recursion:
        unless (defined($io)) {
-               PublicInbox::EvCleanup::asap($cb) if $cb;
-               PublicInbox::EvCleanup::next_tick($cleanup) if $cleanup;
+               PublicInbox::DS::requeue($cb);
+               die 'cleanup unsupported w/o $io' if $cleanup;
                return;
        }
 
@@ -87,7 +87,7 @@ sub close {
 
        # we defer this to the next timer loop since close is deferred
        if (my $cleanup = delete $self->{cleanup}) {
-               PublicInbox::EvCleanup::next_tick($cleanup);
+               PublicInbox::DS::requeue($cleanup);
        }
 }