]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTPD/Async.pm
ds: remove fields.pm usage
[public-inbox.git] / lib / PublicInbox / HTTPD / Async.pm
index 35075d344b0c2848fb8b12efd014c01093b8aa54..87a6a5f9cf015dfab9215231d3d34dc7afdcdb58 100644 (file)
@@ -6,11 +6,16 @@
 # The name of this key is not even stable!
 # Currently intended for use with read-only pipes with expensive
 # processes such as git-http-backend(1), cgit(1)
+#
+# fields:
+# http: PublicInbox::HTTP ref
+# fh: PublicInbox::HTTP::{Identity,Chunked} ref (can ->write + ->close)
+# cb: initial read callback
+# arg: arg for {cb}
+# end_obj: CODE or object which responds to ->event_step when ->close is called
 package PublicInbox::HTTPD::Async;
 use strict;
-use warnings;
-use base qw(PublicInbox::DS);
-use fields qw(http fh cb arg end_obj);
+use parent qw(PublicInbox::DS);
 use Errno qw(EAGAIN);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
 
@@ -27,14 +32,13 @@ sub new {
                die '$end_obj unsupported w/o $io' if $end_obj;
                return;
        }
-
-       my $self = fields::new($class);
+       my $self = bless {
+               cb => $cb, # initial read callback
+               arg => $arg, # arg for $cb
+               end_obj => $end_obj, # like END{}, can ->event_step
+       }, $class;
        IO::Handle::blocking($io, 0);
        $self->SUPER::new($io, EPOLLIN | EPOLLET);
-       $self->{cb} = $cb; # initial read callback
-       $self->{arg} = $arg; # arg for $cb
-       $self->{end_obj} = $end_obj; # like END{}, can ->event_step
-       $self;
 }
 
 sub event_step {