Skip to content

Commit

Permalink
docs: Update openedx-events.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi authored Oct 21, 2024
1 parent 5390db7 commit a76715b
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions docs/concepts/openedx-events.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
Open edX Events
===============

In the context of Open edX, events provide a mechanism for extending the platform by enabling developers to listen to specific Django signals emitted by various services and respond accordingly. This allows for customized reactions to key actions or changes within the platform without modifying the Open edX platform codebase.
Overview
--------

In the context of Open edX, events provide a mechanism for extending the platform by enabling developers to listen to Open edX-specific Django signals emitted by various services and respond accordingly. This allows for customized reactions to key actions or changes within the platform without modifying the Open edX platform codebase.

What are Open edX Events?
-------------------------

An Open edX Event is an Open edX-specific Django signal emitted by a service when a specific action or event occurs. These signals notify other services or components of the platform that an event has taken place, allowing them to respond accordingly. Events are defined using the ``OpenEdxPublicSignal`` class, which provides a structured way to define the data and metadata associated with the event and other relevant information.

Why are Open edX Events important?
----------------------------------

Open edX Events are a key component of the Hooks Extension Framework, which allows developers to extend the platform's functionality in a stable and maintainable way. By triggering events for specific actions or changes within the platform, developers can create event handlers that respond to these events and perform additional actions or processing as needed. This enables many use cases, from integrating with external systems to implementing custom business logic.

How are Open edX Events used?
-----------------------------

Developers can create handlers for Open edX Events by implementing Django signal handlers that respond to these events emitted by the platform. These signal handlers can be registered using Django's signal mechanism, allowing them to listen for events and execute custom logic in response.

For more information on using Open edX Events, refer to the `Using Open edX Events`_ how-to guide.
An Open edX Event is an Open edX-specific Django signal emitted by a service when a specific action or event occurs. These signals notify other services or components of the platform that an event has taken place, allowing them to respond accordingly.

How do Open edX Events work?
----------------------------

Open edX Events are implemented using Django signals, which provide a way to send and receive notifications within a Django application. Due to this design, Open edX Events closely follow the Django signal pattern, allowing developers to leverage their existing knowledge of the framework.
Events are defined using the ``OpenEdxPublicSignal`` class, which provides a structured way to define the data and metadata associated with the event and other relevant information. This class is built on top of the ``Signal`` Django class, which provides a way to send and receive notifications when an action takes place within the Open edX ecosystem. Due to this design, Open edX Events follow the Django signal pattern, allowing developers to leverage their existing knowledge of the framework.

The lifecycle of an Open edX Event can be summarized as follows:

Expand All @@ -41,6 +32,13 @@ Here is an example of how that might look like with an existing event:

The `Django Signals Documentation`_ provides a more detailed explanation of how Django signals work.

How are Open edX Events used?
-----------------------------

Developers can create handlers for Open edX Events by implementing Django signal handlers that respond to these events emitted by the Open edX platform. These signal handlers can be registered using Django's signal mechanism, allowing them to listen for events and execute custom logic in response.

For more information on using Open edX Events, refer to the `Using Open edX Events`_ how-to guide.

.. _Using Open edX Events: ../how-tos/using-events.html
.. _Django Signals Documentation: https://docs.djangoproject.com/en/4.2/topics/signals/
.. _triggering the COURSE_ENROLLMENT_CREATED event: https://github.com/openedx/edx-platform/blob/master/common/djangoapps/student/models/course_enrollment.py#L777-L795
Expand Down

0 comments on commit a76715b

Please sign in to comment.