Need batch read API that takes caller-supplied buffer to fill
- Lingua principale
- Go
- Stelle
- 3
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The current batch read API, `GetN`, creates and returns a new populated buffer on every call. This does not allow the buffer to be reused across multiple calls to `GetN`, and may result in GC that could be avoided by buffer reuse.
To address this, there should be a new API that takes a buffer, provided by the caller, and drains the queue into that buffer. A call to this API returns when the provided buffer is full or when there are no more items in the queue to drain.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia leggendo l’implementazione esistente di GetN e i relativi test per capire come le letture batch riempiono e restituiscono i buffer. Aggiungi la caller-buffer API accanto a quel punto di ingresso, preservando il comportamento indicato di interrompersi quando il buffer è pieno o la coda è vuota. Aggiungi test che coprano il riutilizzo del buffer e entrambe le condizioni di arresto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- go
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 65/100