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.0.tar.gz (11.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: simplarchiver-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4fb593608a372655ac50434b433a072c4fd8daa5b1b90e73dcb6b3a1843137a8
MD5 f19cee25e5ed7dc7404a2935a4f4d5fe
BLAKE2b-256 27be4ea2f20352aa4d9564838b7004e7ddd61a47982db7238215eba99e47764e

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