项目作者: testdrivenio

项目描述 :
asynchronous task queues using python's multiprocessing library
高级语言: Python
项目地址: git://github.com/testdrivenio/simple-task-queue.git
创建时间: 2018-03-29T22:24:16Z
项目社区:https://github.com/testdrivenio/simple-task-queue

开源协议:MIT License

下载


Asynchronous Task Queues in Python

Several implementations of asynchronous task queues in Python using the multiprocessing library and Redis.

Blog post: Developing an Asynchronous Task Queue in Python

Setup

  1. Fork/Clone

  2. Create and activate a virtual environment

  3. Install the dependencies

  4. Enter the Python shell and download the NLTK stopwords corpus:

    1. >> import nltk
    2. >> nltk.download('stopwords')
    3. [nltk_data] Downloading package stopwords to
    4. [nltk_data] /Users/michael.herman/nltk_data...
    5. [nltk_data] Unzipping corpora/stopwords.zip.
    6. True

Examples

Multiprocessing Pool:

  1. $ python simple_pool.py

Multiprocessing Queue:

  1. $ python simple_queue.py
  2. $ python simple_task_queue.py

Logging to a single file:

  1. $ python simple_task_queue_logging.py

Logging to separate files:

  1. $ python simple_task_queue_logging_separate_files.py

Redis:

  1. $ python redis_queue.py