]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTP.pm
mboxgz: do asynchronous git blob retrievals
[public-inbox.git] / lib / PublicInbox / HTTP.pm
index 8281746538e2df420a7003a8fc62cdd2dab159a9..5844ef440f1e8dd324ce6b67401de7c99e696c8e 100644 (file)
@@ -488,6 +488,13 @@ sub busy () {
        ($self->{rbuf} || exists($self->{env}) || $self->{wbuf});
 }
 
+# runs $cb on the next iteration of the event loop at earliest
+sub next_step {
+       my ($self, $cb) = @_;
+       return unless exists $self->{sock};
+       $self->requeue if 1 == push(@{$self->{wbuf}}, $cb);
+}
+
 # Chunked and Identity packages are used for writing responses.
 # They may be exposed to the PSGI application when the PSGI app
 # returns a CODE ref for "push"-based responses