Documentation
¶
Overview ¶
Package streamcopy copies known-length blob streams in larger pooled chunks.
Index ¶
Constants ¶
const BufferSize = 1 << 20
BufferSize balances stream-call reduction against concurrent memory use. At the benchmark's 10 peer serves plus 6 local downloads, a fully busy agent can hold at most roughly 16 MiB of copy buffers.
Variables ¶
This section is empty.
Functions ¶
func BeginActivity ¶ added in v0.26.0
func BeginActivity(change func(int)) func()
BeginActivity returns an idempotent finish callback for one active operation.
func CopyN ¶
CopyN copies exactly size bytes. It fills each pooled chunk before writing, reducing containerd ReaderAt streams and downstream Writer calls while preserving partial bytes and the original read error on interruption.
func Observe ¶ added in v0.26.0
func Observe(body io.ReadCloser, bytes func(int64), finish func()) io.ReadCloser
Observe reports bytes as they are read and finishes on a terminal read or Close. Callbacks must be safe for concurrent calls.
Types ¶
This section is empty.