-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Labels
area:configConfiguration / settingsConfiguration / settingsenhancementNew feature or requestNew feature or requestsize:smallQuick win, < 1 hourQuick win, < 1 hour
Description
Description
The Hassette core event stream buffer size is currently hardcoded to 1000 items, while the web API event buffer is configurable via web_api_event_buffer_size (default 500). This inconsistency makes it impossible for users to tune the core stream buffer based on their event volume.
Current code (core.py:90):
self._send_stream, self._receive_stream = create_memory_object_stream[...](1000)Config precedent (config.py):
web_api_event_buffer_size: int = Field(default=500, ...)Motivation
- Users with high event volume may need larger buffers to prevent backpressure
- Users with low event volume may want smaller buffers to reduce memory footprint
- Consistency: if web_api_event_buffer_size is configurable, core stream should be too
- Tunability: event buffer size affects performance and should be user-controlled
Acceptance Criteria
- Add
hassette_event_buffer_sizefield toHassetteConfig(default 1000 to preserve current behavior) - Update
core.pyline 90 to useself.config.hassette_event_buffer_sizeinstead of hardcoded 1000 - Add docstring explaining what this controls and when users might tune it
- Add test in
test_config.pyverifying the field exists and defaults to 1000 - Update documentation if config is documented elsewhere
Source
Identified during codebase audit on 2026-02-26.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:configConfiguration / settingsConfiguration / settingsenhancementNew feature or requestNew feature or requestsize:smallQuick win, < 1 hourQuick win, < 1 hour
Projects
Status
Done