Skip to content

Conversation

@prosdev
Copy link
Contributor

@prosdev prosdev commented Jan 13, 2026

Summary

Renames Buffer to EventLoader throughout the codebase to better describe what the component does: batching and loading events to storage (backend-agnostic).

Motivation

  • EventLoader more accurately describes the component's purpose
  • Aligns with industry terminology (ETL/ELT loaders)
  • Reflects the EventPlexer pattern from production CDPs (Lytics, RudderStack, Segment)
  • Makes the architecture clearer for users

Changes

Code (Commit 1)

  • Renamed classes:

    • BufferEventLoader
    • BufferStorageEventLoaderStorage
    • InMemoryBufferStorageInMemoryEventLoaderStorage
  • Renamed files:

    • buffer.pyevent_loader.py
    • buffer_storage.pyevent_loader_storage.py
    • test_buffer.pytest_event_loader.py
  • Updated parameters (more descriptive):

    • sizebatch_size
    • max_sizemax_batch_size
    • timeoutflush_interval
  • Updated all references:

    • Processor now uses event_loader instead of buffer
    • Dependencies updated (FastAPI DI)
    • All unit and integration tests updated
    • Docstrings updated

Documentation (Commit 2)

  • README.md, CLAUDE.md, ARCHITECTURE.md
  • LOCAL_DEV.md, TESTING.md, CONTRIBUTING.md
  • specs/: architecture.md, plan.md, tasks.md

Testing

  • All 212 unit tests passing
  • 94% code coverage maintained
  • No breaking changes to public API (internal refactor only)

Note

Ring Buffer references remain unchanged (correctly referring to the Write-Ahead Log layer).

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)
@prosdev prosdev force-pushed the refactor/buffer-to-event-loader branch from d660e97 to 8108d55 Compare January 13, 2026 17:09
@prosdev prosdev merged commit 8a5244c into main Jan 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant