piecewriter

package
v1.12.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PieceWriter

type PieceWriter struct {
	Piece  *piece.Piece
	Source any
	Buffer bufferpool.Buffer

	HashOK bool
	Error  error
}

PieceWriter writes the data in the buffer to disk.

func New

func New(p *piece.Piece, source any, buf bufferpool.Buffer) *PieceWriter

New returns new PieceWriter for a given piece.

func (*PieceWriter) Run

func (w *PieceWriter) Run(resultC chan *PieceWriter, closeC chan struct{}, writesPerSecond, writeBytesPerSecond metrics.Meter, sem *semaphore.Semaphore)

Run checks the hash, then writes the data in the buffer to the disk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL