Skip to content

CongestionControl: replace enum with struct and operation dispatch - #212

Open
rpaulo wants to merge 1 commit into
apple:mainfrom
rpaulo:cc-perf
Open

rpaulo wants to merge 1 commit into
apple:mainfrom
rpaulo:cc-perf

Conversation

@rpaulo

@rpaulo rpaulo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor
  • Convert CongestionControl from an enum into a struct holding all
    controllers, dispatching through CongestionControlOperation and
    CongestionControlQuery protocols to avoid per-call copy-and-reassign.
  • Add placeholder initializers to each controller and make the type
    non-Optional on QUICPath, simplifying all call sites.
  • Generalize inherit(from:) to accept any CongestionControlProtocol
    and centralize re-creation and handoff via reset and switchTo.
  • Add CongestionControlTests covering dispatch, switching, and reset.

- Convert `CongestionControl` from an enum into a struct holding all
  controllers, dispatching through `CongestionControlOperation` and
  `CongestionControlQuery` protocols to avoid per-call copy-and-reassign.
- Add placeholder initializers to each controller and make the type
  non-Optional on `QUICPath`, simplifying all call sites.
- Generalize `inherit(from:)` to accept any `CongestionControlProtocol`
  and centralize re-creation and handoff via `reset` and `switchTo`.
- Add `CongestionControlTests` covering dispatch, switching, and reset.
@rpaulo

rpaulo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

This is a different way of doing #204

We should consider both approaches and find out which one we want to live with.

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