Skip to content

Commit

Permalink
Add warning to Batch* API operations
Browse files Browse the repository at this point in the history
See #1223 (comment) for
more details.

Signed-off-by: Chris Tarazi <[email protected]>
  • Loading branch information
christarazi committed Nov 30, 2023
1 parent 3625965 commit bc109c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,10 @@ func (m *Map) guessNonExistentKey() ([]byte, error) {
// "cursor" to subsequent calls of this function to continue the batching
// operation in the case of chunking.
//
// Warning: This API is not very safe to use as the kernel implementation for
// batching relies on the user to be aware of subtle details with regarding to
// different map type implementations.
//
// ErrKeyNotExist is returned when the batch lookup has reached
// the end of all possible results, even when partial results
// are returned. It should be used to evaluate when lookup is "done".
Expand All @@ -984,6 +988,10 @@ func (m *Map) BatchLookup(cursor *BatchCursor, keysOut, valuesOut interface{}, o
// "cursor" to subsequent calls of this function to continue the batching
// operation in the case of chunking.
//
// Warning: This API is not very safe to use as the kernel implementation for
// batching relies on the user to be aware of subtle details with regarding to
// different map type implementations.
//
// ErrKeyNotExist is returned when the batch lookup has reached
// the end of all possible results, even when partial results
// are returned. It should be used to evaluate when lookup is "done".
Expand Down

0 comments on commit bc109c3

Please sign in to comment.