@@ -259,14 +259,27 @@ type LookupOptions struct {
259
259
// value of 0 means to read to the end of the object.
260
260
To uint64
261
261
262
+ // AlwaysUseRequestedRange indicates the provided range should be used
263
+ // even when the cached item is concurrently streamed.
264
+ //
262
265
// By default, if:
266
+ //
267
+ // - AlwaysUseRequestedRange is false
263
268
// - The size of the cached item's body was not provided by the writer
264
- // - The reader requests a specific range of the cached item's body (`From` and `To` are set)
265
- // - The writer and reader are concurrent, i.e. the body is streamed from one to the other
266
- // then today, the core cache API will ignore the requested range and provide the whole body.
269
+ // - The reader requests a specific range of the cached item's body
270
+ // (`From` and `To` are provided in LookupOptions or GetBodyOptions)
271
+ // - The writer and reader are concurrent, i.e. the body is streamed from
272
+ // the writer to the reader
273
+ //
274
+ // then the core cache API will ignore the requested range, and provide
275
+ // the entire body.
267
276
//
268
- // Setting this flag provides the more intuitive behavior: the range will be respected
269
- // during streaming as well.
277
+ // Setting AlwaysUseRequestedRange to true changes this behavior:
278
+ // - The reader will block until the start of the requested range has been
279
+ // written by the writer. This blocking happens within the
280
+ // TransactionLookup or Lookup call (if the range is provided in
281
+ // LookupOptions) or in GetBody (if the range is provided to GetBody).
282
+ // - Only the requested range will be returned to the reader.
270
283
AlwaysUseRequestedRange bool
271
284
}
272
285
0 commit comments