Skip to content

Rename RegisterHandler to AddHandler in Disposable Funcs API#40

Merged
Hissal merged 2 commits into
mainfrom
copilot/refactor-register-to-add-handler
Feb 21, 2026
Merged

Rename RegisterHandler to AddHandler in Disposable Funcs API#40
Hissal merged 2 commits into
mainfrom
copilot/refactor-register-to-add-handler

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

Pure naming refactor across the Disposable Funcs API surface. No behavior, signature, or disposal semantics changes.

  • Interface: IFuncSubscriber.RegisterHandlerAddHandler (all overloads)
  • Abstract base: AbstractFuncSubscriber.RegisterHandlerAddHandler
  • Implementations: FuncCore, DisposableFunc, FirstFunc
  • Extensions: FuncSubscriberExtensions, VoidFuncExtensions
  • Call sites: Benchmarks, tests
  • XML docs: Updated "registration" → "addition" wording
// Before
func.RegisterHandler(x => FuncResult<int>.From(x * 2));

// After
func.AddHandler(x => FuncResult<int>.From(x * 2));

Repo-wide search confirms zero remaining occurrences of RegisterHandler. All 353 tests pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor: Replace RegisterHandler with AddHandler in Disposable Funcs</issue_title>
<issue_description># Refactor: Replace RegisterHandler with AddHandler in Disposable Funcs

Goal

Standardize the API naming in Disposable Funcs by renaming and updating all references from RegisterHandler to AddHandler.

This is a pure naming refactor:

  • No behavior changes
  • No disposal/lifecycle changes
  • No signature redesign (other than the method name)

Scope

Apply to all places in the repository, including:

  • Public APIs
  • Interfaces
  • Implementations
  • Extension methods
  • Internal call sites
  • XML documentation
  • Unit tests
  • READMEs / docs / examples
  • Comments (where it refers to the method)

Required Changes

1) Rename the method

Rename every RegisterHandler(...) method in the Disposable Funcs API surface to AddHandler(...).

Before

  • RegisterHandler(...)

After

  • AddHandler(...)

Keep everything else identical:

  • Parameters (names/types/defaults)
  • Return type
  • Nullability annotations
  • Generic constraints
  • Overloads

2) Update interfaces + implementations

If any interface exposes RegisterHandler, rename it to AddHandler and update all implementations.

Example shape (do not introduce this exact interface unless it already exists):

  • IDisposable AddHandler(Action<T> handler);

3) Update all call sites

Replace all usages of:

  • someDisposableFunc.RegisterHandler(...)

With:

  • someDisposableFunc.AddHandler(...)

Prefer IDE rename / symbol rename to avoid missing references.


4) Update XML docs + comments

Update all documentation strings to match the new term.

Replace wording such as:

  • “Registers a handler …”
    With:
  • “Adds a handler …”

Also update any <seealso> or references that mention RegisterHandler.


5) Update tests

  • Rename test method names containing RegisterHandler
  • Update test code to call AddHandler
  • Ensure all tests compile and pass
  • If any tests use reflection over method names, update those strings

6) Repo-wide search & cleanup

Ensure zero remaining occurrences of RegisterHandler by searching the repo:

  • Source
  • Tests
  • Docs
  • Examples
  • Comments

Non-Goals

  • Do not change runtime behavior
  • Do not change performance
  • Do not change disposal semantics
  • Do not change handler invocation order or timing
  • Do not rename unrelated APIs

Acceptance Criteria

  • All RegisterHandler method declarations in Disposable Funcs are renamed to AddHandler
  • All interface members updated and implementations compile
  • All call sites updated
  • All XML docs / docs / examples updated
  • Repo search for RegisterHandler returns no matches
  • All unit tests pass
  • CI passes</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Hissal <89788928+Hissal@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor Disposable Funcs to replace RegisterHandler with AddHandler Rename RegisterHandler to AddHandler in Disposable Funcs API Feb 21, 2026
Copilot AI requested a review from Hissal February 21, 2026 16:33
@Hissal Hissal marked this pull request as ready for review February 21, 2026 16:37
@Hissal Hissal merged commit f2c5e5a into main Feb 21, 2026
1 check passed
@Hissal Hissal deleted the copilot/refactor-register-to-add-handler branch February 21, 2026 16:37
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.

Refactor: Replace RegisterHandler with AddHandler in Disposable Funcs

2 participants