Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Oct 17, 2025

This pull request refactors the way switcher executions are tracked and managed, replacing the previous "history" terminology and logic with a clearer "executions" concept. It introduces new methods for managing execution records, improves API clarity, and updates documentation and tests to reflect these changes. This change should also considerably improve performance for local and remote if there is no need to keep the executions results.

Execution management improvements:

  • Replaced the historyExecution map in SwitcherRequest with executionsMap, and updated all related logic and method names to use "executions" instead of "history". This includes renaming updateHistoryExecution to updateExecutions, and updating how results are stored and retrieved. [1] [2] [3] [4]
  • Added flushExecutions() to the Switcher interface and implemented it in SwitcherRequest to allow clearing execution records without affecting input entries. [1] [2]

API and builder enhancements:

  • Added a keepExecutions flag and corresponding keepExecutions() method to SwitcherBuilder, allowing executions to be retained in memory. The throttle() method now automatically enables this. [1] [2] [3]
  • Refactored flush() in SwitcherBuilder to resetInputs(), which now only clears input entries, separating input management from executions management. [1] [2]

Async execution logic:

  • Updated AsyncSwitcher to use the new executions map and methods, ensuring consistent terminology and logic throughout asynchronous operations. [1] [2]

Code consistency and clarity:

  • Updated imports, comments, and variable names across files to reflect the new terminology and improve code readability. [1] [2]

These changes collectively improve the clarity, maintainability, and usability of the switcher API, making execution management more explicit and easier to control.

@petruki petruki added this to the v2.5.2 milestone Oct 17, 2025
@petruki petruki self-assigned this Oct 17, 2025
@petruki petruki added the enhancement New feature or request label Oct 17, 2025
@sonarqubecloud
Copy link

@petruki petruki merged commit 845d2f2 into master-2 Oct 17, 2025
9 checks passed
@petruki petruki deleted the staging branch October 17, 2025 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants