+ # TODO: config option for searching related inboxes
+ inboxes => [ $ibx ],
+ }, $class;
+}
+
+# recreate $oid_want using $hints
+# hints keys: path_a, path_b, oid_a (note: `oid_b' is NOT a hint)
+# Calls {user_cb} with: [ ::Git object, oid_full, type, size, di (diff_info) ]
+# with found object, or undef if nothing was found
+# Calls {user_cb} with a string error on fatal errors
+sub solve ($$$$$) {
+ my ($self, $env, $out, $oid_want, $hints) = @_;
+
+ # should we even get here? Probably not, but somebody
+ # could be manually typing URLs:
+ return done($self, undef) if $oid_want =~ /\A0+\z/;
+
+ $self->{oid_want} = $oid_want;
+ $self->{out} = $out;
+ $self->{seen_oid} = {};
+ $self->{tot} = 0;
+ $self->{psgi_env} = $env;
+ $self->{todo} = [ { %$hints, oid_b => $oid_want } ];
+ $self->{patches} = []; # [ $di, $di, ... ]
+ $self->{found} = {}; # { abbr => [ ::Git, oid, type, size, $di ] }
+ $self->{tmp} = File::Temp->newdir("solver.$oid_want-XXXXXXXX", TMPDIR => 1);
+
+ dbg($self, "solving $oid_want ...");
+ if (my $async = $env->{'pi-httpd.async'}) {
+ # PublicInbox::HTTPD::Async->new
+ $async->(undef, undef, $self);
+ } else {
+ event_step($self) while $self->{user_cb};
+ }