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

Uploaded Source

File details

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

File metadata

  • Download URL: simplarchiver-0.1.3.tar.gz
  • Upload date:
  • Size: 5.1 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-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a6764b28ff6bf1f522ea05b76740e2584d087a55b40d49ad347729d8fec30e03
MD5 580399f451604995e32aa86fe7fd9703
BLAKE2b-256 0db997b000285f83e9cec0637ed3790c53c2e851f85197ef22d01a4a36bbb377

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