]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/EvCleanup.pm
ds: set event flags directly at initialization
[public-inbox.git] / lib / PublicInbox / EvCleanup.pm
index f76fb68159cb97530d0d7ea10b023dfcdd9daa4c..d60ac2cc8c88d3de63288c2d51d517b796e65c1d 100644 (file)
@@ -23,13 +23,13 @@ sub once_init () {
        # fires in the next event loop iteration.
        pipe($r, $w) or die "pipe: $!";
        fcntl($w, 1031, 4096) if $^O eq 'linux'; # 1031: F_SETPIPE_SZ
-       $self->SUPER::new($w);
+       $self->SUPER::new($w, 0);
 
-       # always writable, since PublicInbox::EvCleanup::event_write
+       # always writable, since PublicInbox::EvCleanup::event_step
        # never drains wbuf.  We can avoid wasting a hash slot by
        # stuffing the read-end of the pipe into the never-to-be-touched
        # wbuf
-       push @{$self->{wbuf}}, $r;
+       $self->{wbuf} = $r;
        $self;
 }
 
@@ -57,7 +57,7 @@ sub _run_later () {
 }
 
 # Called by PublicInbox::DS
-sub event_write {
+sub event_step {
        my ($self) = @_;
        $self->watch_write(0);
        _run_asap();