Skip to main content

Module transfer_limits

Module transfer_limits 

Source
Expand description

Rolling-window transfer quotas and a queue of content waiting for budget.

iroh-blobs has no per-request rate limiter and iroh-docs downloads eagerly, so instead of trying to throttle a transfer in flight this module implements a download policy in the spirit of qBittorrent: transfers are queued and only start when their full size fits inside every configured per-hour, per-day, and per-month byte quota. Sharing (upload) is bounded by pausing the folder’s live session when an upload quota would be exceeded.

Structs§

PendingTransfer
A blob waiting for download budget.
TransferBudget
Rolling byte accounting against a set of TransferLimits.
TransferLimits
Parsed per-direction quotas.
TransferLimitsConfig
Serializable [transfer_limits] configuration.
TransferQueue
Size-prioritized queue of blobs waiting for their download quota.
TransferQuota
Parsed byte quotas for one direction. None means unlimited.

Enums§

Direction
Which side of a transfer a quota applies to.

Constants§

WINDOW_DAY
Rolling window for the per-day quota.
WINDOW_HOUR
Rolling window for the per-hour quota.
WINDOW_MONTH
Rolling window for the per-month quota (30 days).