refactor: extract DownloadStore from ClientContext
Move the Vec<Download> and the download lifecycle methods (add, remove, lookup, status update, pause, resume, remove-if-queued) into a new download_store module. ClientContext keeps thin delegating shims so peer/listen, peer/download_peer and the existing client tests carry on unchanged. Client::pause_download / resume_download / remove_queued_download now delegate one-liners. Client::process_failed_uploads keeps the read-then-write lock dance but the inner filtering is the new collect_failed_tokens helper. Adds dedicated unit tests for the store's behavior (add/get/remove, pause+resume, queued-only removal, failed-token collection) so the state-machine logic is exercised independently of Client.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
pub mod actor;
|
||||
pub mod client;
|
||||
pub mod dispatcher;
|
||||
pub mod download_store;
|
||||
pub mod error;
|
||||
pub mod message;
|
||||
pub mod peer;
|
||||
|
||||
Reference in New Issue
Block a user