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

Uploaded Source

File details

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

File metadata

  • Download URL: simplarchiver-1.2.0.tar.gz
  • Upload date:
  • Size: 11.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 6f40803d8d5d8390c11373b397099b3060033d9cfcae82e5920865a26d351b2f
MD5 b63c21de420516fbfc885dff81749a6e
BLAKE2b-256 b61e8c23dc5d97ee93518beacda50292152f69b75056c04d0ed308a52fe3f2e2

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