Repository navigation
[cpp] Allow starting lookups without blocking - #4559
Conversation
|
Hi @fresh-borzoni, thanks for working on this. |
|
Thanks for the review @naivedogger! I'd keep the handle as the base async API: it's the future Java, Rust and Python already return, and it covers the simple start-now, wait-later case without a polling loop or request IDs. |
naivedogger
left a comment
There was a problem hiding this comment.
@fresh-borzoni Keeping the handle API here and adding polling in a follow-up sounds good to me. Overall, LGTM, with just one minor comment on the timeout documentation.
d96b47b to
ed35ab8
Compare
|
@naivedogger Thank you for the review, addressed, PTAL Filed #4705 as a followup |
|
@fresh-borzoni Thanks for the update. LGTM. |
closes #4558
A C++ lookup blocks until its result arrives, and each lookup waits for the 100 ms batch window, so one thread gets about 10 lookups per second. In Java, Rust and Python lookup() returns a future, so one thread can keep many lookups in flight.
This adds Lookuper::Lookup(pk_row, PendingLookup&) and PrefixLookuper::PrefixLookup(prefix_row, PendingPrefixLookup&), which start the lookup and return at once, the same shape as Append(row, WriteResult&). Wait(out) collects the result. Wait(out, timeout_ms) returns the retriable REQUEST_TIME_OUT if the result isn't there yet and leaves the lookup running, so it can be waited for again.
Destroying the handle before Wait returns abandons the lookup.