Documentation
¶
Overview ¶
Package requestbuffer coalesces concurrent reads of the same expensive resource into a single fetch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer[T any] struct { // contains filtered or unexported fields }
Buffer batches requests per key: the first request opens a window, every request arriving within it joins the batch, and a single fetch serves them all. The fetch starts only after the window closed, so a caller never observes data read before its own request.
Click to show internal directories.
Click to hide internal directories.