From bafcb7ab7c6c7b1f4b9f2d50c888cf3f570414b3 Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Fri, 8 Dec 2023 17:25:19 +0530 Subject: [PATCH] docs: simplify consuming docs in how-to --- CHANGELOG.rst | 2 +- ....rst => add-new-event-bus-concrete-implementation.rst} | 8 ++++++-- docs/how-tos/index.rst | 2 +- openedx_events/__init__.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) rename docs/how-tos/{add-new-implementation.rst => add-new-event-bus-concrete-implementation.rst} (56%) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ac54bb759..6c7cfd19c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,7 +14,7 @@ Change Log Unreleased ---------- -[9.2.1] - 2023-12-08 +[9.3.0] - 2023-12-08 -------------------- Added ~~~~~ diff --git a/docs/how-tos/add-new-implementation.rst b/docs/how-tos/add-new-event-bus-concrete-implementation.rst similarity index 56% rename from docs/how-tos/add-new-implementation.rst rename to docs/how-tos/add-new-event-bus-concrete-implementation.rst index f0be7af8c..138b63b0e 100644 --- a/docs/how-tos/add-new-implementation.rst +++ b/docs/how-tos/add-new-event-bus-concrete-implementation.rst @@ -4,11 +4,13 @@ How to add a new concrete implementation of the event bus Context ------- -Though the initial Open edX event bus was implemented using Kafka, the ultimate goal is for maintainers to be able to swap out different technologies like Redis or Pulsar. See `How to start using the Event bus `_ for more information. Existing Concrete Implementations +Here is a list of the existing concrete implementations of the event bus: - `Kafka `_ - `Redis Streams `_ +This how-to is to help you add a new concrete implementation, for example using Pulsar or some other technology. + Producing --------- @@ -23,7 +25,9 @@ At a high level, the consumer should be a process that takes the signals and eve The consumer class then needs to implement ``consume_indefinitely`` loop, which will stay running and listen to events as they come in. -If you are doing this within Django, one thing to be aware of is Django will not do any of the automatic connection cleanup that it usually does per request. This means that if your database restarts while the ``consume_indefinitely`` loop is running, Django may try to hold on to a defunct connection. To address this, we have included an `utility function <../../openedx_events/tooling.py#L323>`_ in openedx-events which needs to called before processing any signal. Checkout `consumer.py `_ in event bus redis implementation. We’re also resetting the RequestCache in the utility function, and there may be later, more comprehensive changes.. +We have included an `utility function <../../openedx_events/tooling.py#L323>`_ in openedx-events which needs to be called before processing any signal. Currently, it reconnects the db connection if required as well as clears RequestCache and there may be later, more comprehensive changes. These steps mimic some setup/teardown that is normally performed by Django in its request/response based architecture. + +Checkout `consumer.py `_ in event bus redis implementation. Abstraction tickets ------------------- diff --git a/docs/how-tos/index.rst b/docs/how-tos/index.rst index 132baca52..3c210b0c2 100644 --- a/docs/how-tos/index.rst +++ b/docs/how-tos/index.rst @@ -9,4 +9,4 @@ How-tos adding-events-to-a-service adding-events-to-event-bus using-events - add-new-implementation + add-new-event-bus-concrete-implementation diff --git a/openedx_events/__init__.py b/openedx_events/__init__.py index 3a2371b99..bb45b9cd7 100644 --- a/openedx_events/__init__.py +++ b/openedx_events/__init__.py @@ -5,4 +5,4 @@ more information about the project. """ -__version__ = "9.2.1" +__version__ = "9.3.0"