-
Notifications
You must be signed in to change notification settings - Fork 4
Extract ListenerOptions dataclass to reduce Listener.create() parameter fan-out #438
Copy link
Copy link
Open
Labels
area:busEvent busEvent busenhancementNew feature or requestNew feature or requestsize:smallQuick win, < 1 hourQuick win, < 1 hour
Milestone
Description
Description
Listener.create() accepts 12 parameters. Adding a new listener option (e.g., max_retries, timeout) requires changes across 5 layers:
Listenerdataclass fieldsListener.create()signatureBus.on()signatureBus._subscribe()OptionsTypedDict- Every
on_*method that passes**opts
Proposed Change
Extract a ListenerOptions dataclass from the behavioral parameters (once, debounce, throttle, priority). Bus.Options TypedDict becomes a constructor for it. Listener.create() takes a single options: ListenerOptions instead of 4 separate parameters. Future options are added in one place.
Acceptance Criteria
-
ListenerOptionsdataclass exists withonce,debounce,throttle,priority -
Listener.create()acceptsoptions: ListenerOptionsinstead of 4 separate params - Adding a new option only requires changes in 2 places (ListenerOptions + implementation)
- All tests pass
Source: challenge finding from #434 review (systems architect).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:busEvent busEvent busenhancementNew feature or requestNew feature or requestsize:smallQuick win, < 1 hourQuick win, < 1 hour
Projects
Status
Refinement