Golang multithreaded/concurrent downloader. Work in progress, any contribution or feedback is appreciated!
go get github.com/husseinelguindi/mtd
- Concurrent chunked download through Goroutines
- HTTP/HTTPS download support
- Offset write to file
- Synchronized writing to file (never write 2 things at once)
- Go module/library interface
- Multiple downloads in a single instance
- Pause/resume support
- Command line interface
- Args
- Console input
A writer Goroutine that only writes one chunk at a time, this was done for a number of a simple reason:
- Seeking to a location in a file, physically moves the write head of a hard drive, which slows the writing to a file.
- This means that writing chunks, that are near each other, would yield better performance, avoiding the hard drive seek delay.
- This also means that using a bigger chunk/buffer size is beneficial to write speeds (less system calls, as well).