manager

package
v3.3.357 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConcurrentFiles is the default number of files a transfer job may process at once.
	ConcurrentFiles = 50
	// ConcurrentFileParts is the default job-wide cap for concurrent upload/download part work.
	ConcurrentFileParts = 50
	// ConcurrentDirectoryList is the default number of local directory listing operations that may run at once.
	ConcurrentDirectoryList = 100
	// AdaptiveUploadV2ConcurrentFiles is the V2 upload job-level file concurrency cap.
	// Adaptive upload V2 still controls HTTP part concurrency dynamically; this value prevents
	// large multi-file jobs from being serialized while the per-destination controller learns.
	// The default is documented in docs/adaptive-upload-v2-file-concurrency-cap.md.
	AdaptiveUploadV2ConcurrentFiles = 128
	// AdaptiveUploadV2ConcurrentFileParts is the V2 upload HTTP part concurrency cap.
	// The adaptive manager treats this as a maximum, not a fixed target.
	AdaptiveUploadV2ConcurrentFileParts = 1024
	// AdaptiveDownloadV2ConcurrentFiles is the V2 download job-level file concurrency cap.
	AdaptiveDownloadV2ConcurrentFiles = 128
	// AdaptiveDownloadV2ConcurrentFileParts is the V2 download HTTP range concurrency cap.
	// The adaptive manager treats this as a maximum, not a fixed target.
	AdaptiveDownloadV2ConcurrentFileParts = 1024
	// AdaptiveFileAdmissionFloor is the minimum number of concurrent files
	// adaptive transfers keep admitted however low the learned part
	// concurrency falls, so indexing, finishing, and growth probing still
	// overlap.
	AdaptiveFileAdmissionFloor = 4
)

Functions

func EffectiveAdaptiveDownloadV2ConcurrentFileParts added in v3.3.141

func EffectiveAdaptiveDownloadV2ConcurrentFileParts(defaultMax ...int) int

EffectiveAdaptiveDownloadV2ConcurrentFileParts returns the adaptive download V2 max with the process-wide override applied, when one is configured.

func EffectiveAdaptiveUploadV2ConcurrentFileParts added in v3.3.141

func EffectiveAdaptiveUploadV2ConcurrentFileParts(defaultMax int) int

EffectiveAdaptiveUploadV2ConcurrentFileParts returns defaultMax capped by the process-wide adaptive upload V2 override, when one is configured.

func SetAdaptiveDownloadV2ConcurrentFileParts added in v3.3.141

func SetAdaptiveDownloadV2ConcurrentFileParts(maxConcurrentFileParts int)

SetAdaptiveDownloadV2ConcurrentFileParts sets the process-wide maximum for adaptive download V2 HTTP range concurrency. Values less than 1 reset the SDK to its default.

func SetAdaptiveUploadV2ConcurrentFileParts added in v3.3.141

func SetAdaptiveUploadV2ConcurrentFileParts(maxConcurrentFileParts int)

SetAdaptiveUploadV2ConcurrentFileParts sets the process-wide maximum for adaptive upload V2 HTTP part concurrency. Values less than 1 reset the SDK to its target-specific defaults.

Types

type ConcurrencyManager

type ConcurrencyManager struct {
	*lib.ConstrainedWorkGroup
	DownloadFilesAsSingleStream bool
}

func (ConcurrencyManager) Max

func (c ConcurrencyManager) Max() int

func (ConcurrencyManager) New

func (ConcurrencyManager) New(maxGoRoutines int, downloadFilesAsSingleStream ...bool) ConcurrencyManager

type Manager

type Manager struct {
	FilesManager            ConcurrencyManager
	FilePartsManager        ConcurrencyManager
	DirectoryListingManager ConcurrencyManager
}

func Build

func Build(maxConcurrentConnections, maxConcurrentDirectoryLists int, downloadFilesAsSingleStream ...bool) *Manager

func Default

func Default() *Manager

func New

func New(files, fileParts, directoryListing int) *Manager

func SharedDefault added in v3.3.130

func SharedDefault() *Manager

func Sync

func Sync() *Manager

func (*Manager) CreateMatchingClient added in v3.0.3

func (m *Manager) CreateMatchingClient(client *http.Client) *http.Client

CreateMatchingClient returns a client whose transport allows as many connections per host as FilePartsManager allows parts at once. It never changes client or its transport, which other requests may be using: it returns client itself when the transport's cap already matches, or when the transport is a RoundTripper it cannot configure (such as a test recorder); otherwise a copy of client on a new transport configured like client's (lib.CloneHTTPClientWithMatchingMaxConnsPerHost), or, for a client on the standard default transport, on a new SDK pooled transport. A new transport's connections belong to the caller, which should close its idle connections once its transfers are done.

func (*Manager) TransferStats added in v3.3.155

func (m *Manager) TransferStats() TransferStats

TransferStats returns the transfer worker usage for this manager.

type TransferStats added in v3.3.155

type TransferStats struct {
	Active int
	Max    int
}

TransferStats describes current transfer worker usage.

Jump to

Keyboard shortcuts

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