Skip to main content

一个简单的可扩展聚合异步下载器框架

Project description

simplarchiver

一个简单的可扩展聚合异步下载器框架(Python协程小练习)

简单到只有两种自定义的组件:

  • feeder:获取要下载的items
  • downloader:接收feeder给的items,进行下载

和一个核心组件controller。核心组件的功能是:

  • 调用feeder获取要下载的items,调用downloader进行下载
  • 维护一个feeder-downloader对列表
  • 定时执行feeder-downloader对列表中的下载任务
  • 维护feeder和downloader的任务队列及线程池

程序执行的流程如下:

  1. 创建downloader下载队列,启动downloader等待下载
  2. 启动feeder获取要下载的items
  3. 对于每个item,在所有的downloader下载队列里面放一个
  4. items发完之后向每个downloader下载队列发送None作为停止信号
  5. downloader运行完所有的下载任务后收到最后的停止信号就退出
  6. feeder等待所有downloader退出
  7. sleep指定的时间,回到步骤1

一些例程可以参见exampletest_*.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplarchiver-1.1.1.tar.gz (11.5 kB view details)

Uploaded Source

File details

Details for the file simplarchiver-1.1.1.tar.gz.

File metadata

  • Download URL: simplarchiver-1.1.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for simplarchiver-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b710574f91f825e2158e5930694db0547fedc3e0ea9c1636f8d55e86f2314123
MD5 15b345b082826bddeb801dfaa72696a7
BLAKE2b-256 5ab1d1c24418b86b5579bc3c72a6aadae57c1b4c1d8a148f1340f44c7f4a775d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page