Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timmc-edx committed Aug 22, 2022
1 parent bd08d1e commit bb6c2cd
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions edx_event_bus_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
Kafka implementation for Open edX event bus.
"""

from openedx_events.event_bus import EventBus
from openedx_events.event_bus import EventProducer

from edx_event_bus_kafka.consumer.event_consumer import consume_indefinitely
from edx_event_bus_kafka.publishing.event_producer import send_to_event_bus

__version__ = '0.4.1'


class EventBusKafka(EventBus):
"""Kafka implementation of the EventBus API."""
class EventProducerKafka(EventProducer):
"""Kafka implementation of the EventBus Producer API."""

def __init__(config):
def __init__():
... # TODO Read config here and create producer and consumer?

def send(
Expand All @@ -24,12 +24,11 @@ def send(
signal=signal, topic=topic, event_key_field=event_key_field, event_data=event_data, sync=sync
)

def consume_indefinitely(self, *, topic: str, group_id: str) -> NoReturn:
consume_indefinitely(topic=topic, group_id=group_id)
class EventProducerKafka(EventProducer):
"""Kafka implementation of the EventBus Producer API."""

def __init__():
... # TODO Read config here and create producer and consumer?

def create(config) -> EventBusKafka:
"""
Create the Kafka implementation of the EventBus API.
"""
return EventBusKafka(config)
def consume_indefinitely(self, *, topic: str, group_id: str) -> NoReturn:
consume_indefinitely(topic=topic, group_id=group_id)

0 comments on commit bb6c2cd

Please sign in to comment.