Skip to main content

Module queue

Module queue 

Source
Expand description

Torrent queue + auto-management (active/seeding caps, FIFO position). Queue position arithmetic for auto-managed torrents.

Structs§

QueueCandidate
Snapshot of a torrent for queue evaluation.
QueueConfig
Named configuration for queue evaluation limits.
QueueDecision
Result of queue evaluation: which torrents to start and stop.
QueueEntry
Compact representation of a queued torrent for position operations.

Enums§

QueueCategory
Classification of a torrent for queue evaluation.

Functions§

apply_preemption
Post-pass: for each category, if a queued torrent has strictly higher priority (lower position) than the lowest-priority active torrent, swap them. One swap per category per tick to prevent cascade instability.
compute_seed_rank
Compute swarm demand rank for a seeding torrent.
evaluate
Evaluate the queue and decide which torrents to start/stop.
move_bottom
Move to last position (lowest priority). Returns changes.
move_down
Move one position down. Returns changes.
move_top
Move to position 0 (highest priority). Returns changes.
move_up
Move one position up (lower number = higher priority). Returns changes.
remove_position
Removes a position and shifts all positions above it down by 1. Returns the list of (info_hash, old_pos, new_pos) that changed.
set_position
Moves a torrent to a new absolute position. Shifts others to maintain density. Returns the list of (info_hash, old_pos, new_pos) for all changed entries.