Commit dcfa3b8
feat(c-sdk): optional version/size fast-path and concurrent block reads (#564)
talon_read_async gains a version (const char*) and object_size
(const uint64_t*) parameter pair, each independently nullable. NULL means
the caller does not have that value. The read skips the StatObject control
round trip only when BOTH are non-NULL, using the caller-supplied version
and size; if either is NULL the SDK resolves both with a stat and ignores
any lone value, since a read cannot skip the stat without both halves.
Making object_size a pointer lets a caller that has a version but no valid
size say so (NULL) instead of guessing, and disambiguates a real empty
object (points to 0 -> zero-byte read, no stat) from "unknown" (NULL).
When used, *object_size bounds the read at EOF: smaller than the range is
a POSIX short read, larger surfaces as a clear worker error rather than
fabricated bytes.
The per-block fetches a multi-block read spans now run concurrently on the
runtime (JoinSet over disjoint 'static sub-slices of the caller buffer)
instead of a serial await loop, so a large read no longer pays one worker
RTT per block in series.
Header, smoke test, example, and the MinIO e2e are updated to the new
signature; the e2e also adds a fast-path case that reuses the version and
size from its stat.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent d7fad09 commit dcfa3b8
5 files changed
Lines changed: 390 additions & 32 deletions
File tree
- clients/c
- examples
- include
- src
- tests
- test/sdk/c
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
70 | 85 | | |
71 | 86 | | |
72 | 87 | | |
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
76 | 91 | | |
| 92 | + | |
| 93 | + | |
77 | 94 | | |
78 | 95 | | |
79 | 96 | | |
| |||
0 commit comments