refactor: rename Buffer to EventLoader for clarity#23
Merged
Conversation
Buffer → EventLoader refactor to better describe what the component does: batching and loading events to storage (backend-agnostic). **Changes**: 1. **Renamed files**: - buffer.py → event_loader.py - buffer_storage.py → event_loader_storage.py - test_buffer.py → test_event_loader.py 2. **Renamed classes**: - Buffer → EventLoader - BufferStorage → EventLoaderStorage - InMemoryBufferStorage → InMemoryEventLoaderStorage 3. **Renamed parameters** (more descriptive): - size → batch_size - max_size → max_batch_size - timeout → flush_interval 4. **Updated all references**: - Processor now uses event_loader instead of buffer - Dependencies updated (FastAPI DI) - All unit and integration tests updated - Docstrings updated to reflect new terminology **Why this change**: - EventLoader better describes the component's purpose - Aligns with industry terminology (ETL/ELT loaders) - Reflects the EventPlexer pattern from production CDPs - Makes the architecture clearer for users **Testing**: - All 212 unit tests passing - 94% code coverage maintained
Updated all markdown documentation to reflect the Buffer → EventLoader refactor: **Files Updated**: - README.md - Component table and flow diagram - CLAUDE.md - Logging and architecture examples - ARCHITECTURE.md - Phase diagrams, component sections, code examples - LOCAL_DEV.md - Configuration table, logging reference - TESTING.md - Test examples - CONTRIBUTING.md - PR examples - specs/core-pipeline/architecture.md - Full component documentation - specs/core-pipeline/plan.md - Implementation plan, file paths, examples - specs/core-pipeline/tasks.md - Task descriptions, file references **Changes**: - Buffer → EventLoader (class and concept) - BufferStorage → EventLoaderStorage (protocol) - buffer.py → event_loader.py (file paths) - buffer_storage.py → event_loader_storage.py (file paths) - size → batch_size (parameters) - timeout → flush_interval (parameters) **Note**: Ring Buffer references remain unchanged (correct - referring to WAL)
d660e97 to
8108d55
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renames
BuffertoEventLoaderthroughout the codebase to better describe what the component does: batching and loading events to storage (backend-agnostic).Motivation
EventLoadermore accurately describes the component's purposeChanges
Code (Commit 1)
Renamed classes:
Buffer→EventLoaderBufferStorage→EventLoaderStorageInMemoryBufferStorage→InMemoryEventLoaderStorageRenamed files:
buffer.py→event_loader.pybuffer_storage.py→event_loader_storage.pytest_buffer.py→test_event_loader.pyUpdated parameters (more descriptive):
size→batch_sizemax_size→max_batch_sizetimeout→flush_intervalUpdated all references:
event_loaderinstead ofbufferDocumentation (Commit 2)
Testing
Note
Ring Buffer references remain unchanged (correctly referring to the Write-Ahead Log layer).