- $ctx->{feed_base_url} = $ctx->{-inbox}->base_url($ctx->{env});
- bless { cb => $cb || *close, ctx => $ctx }, $class;
+ bless $ctx, $class;
+}
+
+sub async_next ($) {
+ my ($http) = @_; # PublicInbox::HTTP
+ my $ctx = $http->{forward} or return;
+ eval {
+ if (my $smsg = $ctx->{smsg} = $ctx->{cb}->($ctx)) {
+ $ctx->smsg_blob($smsg);
+ } else {
+ $ctx->write('</feed>');
+ $ctx->close;
+ }
+ };
+ warn "E: $@" if $@;
+}
+
+sub async_eml { # for async_blob_cb
+ my ($ctx, $eml) = @_;
+ my $smsg = delete $ctx->{smsg};
+ $smsg->{mid} // $smsg->populate($eml);
+ $ctx->write(feed_entry($ctx, $smsg, $eml));