Skip to main content

Celery tasks supporting the operations of edX's ecommerce service

Project description

The Celery tasks contained herein are used to implement asynchronous order fulfillment and other features requiring the asynchronous execution of many small, common operations.

Prerequisites

  • Python 2.7.x (not tested with Python 3.x)

  • Celery 3.1.x

  • RabbitMQ 3.5.x

Getting Started

Most commands necessary to develop and run this app can be found in the included Makefile. These instructions assume a working integration between the edX ecommerce service and the LMS, with asynchronous fulfillment configured on the ecommerce service.

To get started, create a new virtual environment and install the included requirements.

$ make requirements

This project uses Celery to asynchronously execute tasks, such as those required during order fulfillment. Celery requires a solution to send and receive messages which typically comes in the form of a separate service called a message broker. This project uses RabbitMQ as a message broker. On OS X, use Homebrew to install it.

$ brew install rabbitmq

By default, most operating systems don’t allow enough open files for a message broker. RabbitMQ’s docs indicate that allowing at least 4096 file descriptors should be sufficient for most development workloads. Check the limit on the number of file descriptors in your current process.

$ ulimit -n

If it needs to be adjusted, run:

$ ulimit -n 4096

Next, start the RabbitMQ server.

$ rabbitmq-server

In a separate process, start the Celery worker.

$ make worker

In a third process, start the ecommerce service. In order for tasks to be visible to the ecommerce worker, the value of Celery’s BROKER_URL setting must shared by the ecommerce service and the ecommerce worker.

Finally, in a fourth process, start the LMS. At this point, if you attempt to enroll in a course supported by the ecommerce service, enrollment will be handled asynchronously by the ecommerce worker.

If you’re forced to shut down the Celery workers prematurely, tasks may remain in the queue. To clear them, you can reset RabbitMQ.

$ rabbitmqctl stop_app $ rabbitmqctl reset $ rabbitmqctl start_app

License

The code in this repository is licensed under the AGPL unless otherwise noted. Please see LICENSE.txt for details.

How To Contribute

Contributions are welcome. Please read How To Contribute for details. Even though it was written with edx-platform in mind, these guidelines should be followed for Open edX code in general.

Reporting Security Issues

Please do not report security issues in public. Please email security@edx.org.

Mailing List and IRC Channel

You can discuss this code in the edx-code Google Group or in the #edx-code IRC channel on Freenode.

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

edx-ecommerce-worker-0.8.3.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

edx_ecommerce_worker-0.8.3-py2-none-any.whl (32.8 kB view details)

Uploaded Python 2

File details

Details for the file edx-ecommerce-worker-0.8.3.tar.gz.

File metadata

  • Download URL: edx-ecommerce-worker-0.8.3.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/2.7.15

File hashes

Hashes for edx-ecommerce-worker-0.8.3.tar.gz
Algorithm Hash digest
SHA256 f273eb31375b1ecdad11aaaf8fef7306b64a574cfebf6df254bae719b49c37d4
MD5 a215e1968b6cd034bd9953fdecd14d7a
BLAKE2b-256 2d7147c7cddbd75584544dcc54c2e942bebc7d80cc2e2530ab80e2770126b2e5

See more details on using hashes here.

File details

Details for the file edx_ecommerce_worker-0.8.3-py2-none-any.whl.

File metadata

  • Download URL: edx_ecommerce_worker-0.8.3-py2-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/2.7.15

File hashes

Hashes for edx_ecommerce_worker-0.8.3-py2-none-any.whl
Algorithm Hash digest
SHA256 441df71ad9ebb255cbd3c1ef5de4171ce4d06ffa20d4d5a1c8ef5f563d09c329
MD5 c64cbab3137d8ee2e609cdafe72f0c60
BLAKE2b-256 8a8e9d6aa02cf376347e0d516e0a8e151e3881b43c4e9feeddcff664f69df4c5

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