Skip to content

Commit 8b81643

Browse files
azatclaude
andcommitted
Stream perfetto source fetches via per-block callbacks
Replace the *_for_perfetto_sql() -> Result<String> methods (built the SQL in one place, executed it in another) with *_for_perfetto(args, on_block) that encapsulate the SQL and stream through execute_for_each(), the same model as get_query_logs(). execute_into() is deleted - execute_for_each() is the single streaming primitive now. The bounded channel in the worker stays: it is what serializes the concurrently-fetched sources into the single &mut PerfettoTraceBuilder consumer. stream_perfetto_source() shrinks to the error-tolerance wrapper (skip a source on UNKNOWN_TABLE/CANNOT_EXTRACT_TABLE_STRUCTURE) around the fetch future, and apply_via() builds the per-block callback that defers applying the block by sending it into the channel. The separate "Failed to build query" log path is gone - SQL-build errors now surface through the fetch result like any other error. Integration tests collect the streamed blocks via the fetch_streamed! macro (fixture results fit in a single block, keeping the assertions unchanged); find_rows() becomes generic since streamed blocks are Block<Simple>, not the Block<Complex> of fetch_all(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b04ed8e commit 8b81643

3 files changed

Lines changed: 318 additions & 323 deletions

File tree

0 commit comments

Comments
 (0)