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

Uploaded Source

File details

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

File metadata

  • Download URL: simplarchiver-1.0.3.tar.gz
  • Upload date:
  • Size: 5.2 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.0.3.tar.gz
Algorithm Hash digest
SHA256 9f11bf33bcc0db5cb5266e8e342ee7d4f819f08fd0f7c04046106ecf8bf1a788
MD5 3041c3dbed3e5754eeb49fdfd8df8daf
BLAKE2b-256 d4b345e6a47a7180feb51377a7bae4345b1ebffaa5f24ae6324d87cf62aa3b08

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