Skip to content

Commit dfe1754

Browse files
committed
refactor: Rename concrete event processor to DefaultAsyncEventProcessor
Implement the new AsyncEventProcessor interface with a concrete DefaultAsyncEventProcessor, matching the sync DefaultEventProcessor naming convention.
1 parent a4272d0 commit dfe1754

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

ldclient/impl/events/async_event_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
check_if_error_is_recoverable_and_log,
3737
log
3838
)
39-
from ldclient.interfaces import EventProcessor
39+
from ldclient.interfaces import AsyncEventProcessor
4040

4141
__MAX_FLUSH_THREADS__ = 5
4242
__CURRENT_EVENT_SCHEMA__ = 4
@@ -178,7 +178,7 @@ async def _do_shutdown(self):
178178
await self._http.close()
179179

180180

181-
class AsyncEventProcessor(EventProcessor):
181+
class DefaultAsyncEventProcessor(AsyncEventProcessor):
182182
def __init__(self, config: AsyncConfig, http=None, dispatcher_class=None, diagnostic_accumulator=None):
183183
self._inbox = AsyncQueue(config.events_max_pending)
184184
self._inbox_full = False

ldclient/testing/impl/events/test_async_event_processor.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Tests for AsyncEventProcessor.
2+
Tests for DefaultAsyncEventProcessor.
33
44
These mirror the sync DefaultEventProcessor tests: the processor is driven
55
through its public API plus the ``_wait_until_inactive`` test handshake, and
@@ -19,7 +19,9 @@
1919

2020
from ldclient.async_config import AsyncConfig
2121
from ldclient.context import Context
22-
from ldclient.impl.events.async_event_processor import AsyncEventProcessor
22+
from ldclient.impl.events.async_event_processor import (
23+
DefaultAsyncEventProcessor
24+
)
2325
from ldclient.impl.events.diagnostics import (
2426
_DiagnosticAccumulator,
2527
create_diagnostic_id
@@ -111,14 +113,14 @@ async def make_processor(mock_http: MockAioHttp, **kwargs):
111113
kwargs.setdefault('sdk_key', 'SDK_KEY')
112114
config = AsyncConfig(**kwargs)
113115
diagnostic_accumulator = _DiagnosticAccumulator(create_diagnostic_id(config))
114-
ep = AsyncEventProcessor(config, mock_http, diagnostic_accumulator=diagnostic_accumulator)
116+
ep = DefaultAsyncEventProcessor(config, mock_http, diagnostic_accumulator=diagnostic_accumulator)
115117
try:
116118
yield ep
117119
finally:
118120
await ep.stop()
119121

120122

121-
async def flush_and_get_events(ep: AsyncEventProcessor, mock_http: MockAioHttp):
123+
async def flush_and_get_events(ep: DefaultAsyncEventProcessor, mock_http: MockAioHttp):
122124
ep.flush()
123125
await ep._wait_until_inactive()
124126
if mock_http.request_data is None:
@@ -398,7 +400,7 @@ async def event_consumer():
398400
return
399401

400402
mock_http = MockAioHttp()
401-
ep = AsyncEventProcessor(config, mock_http, dispatcher_factory)
403+
ep = DefaultAsyncEventProcessor(config, mock_http, dispatcher_factory)
402404
ep_inbox = ep_inbox_holder[0]
403405
event1 = EventInputCustom(timestamp, context, 'event1')
404406
event2 = EventInputCustom(timestamp, context, 'event2')

0 commit comments

Comments
 (0)