Code Monkey home page Code Monkey logo

ecommerce-worker's Introduction

edX Ecommerce Worker Travis Codecov

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 [email protected].

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.

ecommerce-worker's People

Contributors

cclauss avatar clintonb avatar irfanuddinahmad avatar cpennington avatar mattdrayer avatar mikedikan avatar syedimranhassan avatar schenedx avatar feanil avatar uzairr avatar syed-awais-ali avatar morenol avatar dario617 avatar ayub-khan avatar paulwattenberger avatar nadeemshahzad avatar maxrothman avatar jdmulloy avatar jmyatt avatar dillon-dumesnil avatar coryleeio avatar brittneyexline avatar awais786 avatar adeelkhan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.