Skip to content

Conversation

@vwxyzh
Copy link
Contributor

@vwxyzh vwxyzh commented Oct 27, 2025

This pull request refactors the PauseHandler class and updates its usage throughout the codebase to improve clarity and consistency in pausing and resuming client connections. The main changes include renaming methods for clarity, updating method calls, and revising the logic for handling outgoing messages during pauses.

PauseHandler API changes:

  • Renamed ShouldReplyAck property to a method ShouldReplyAck() for clarity and updated all usages accordingly. [1] [2] [3]
  • Replaced WaitAsync with TryAcquire, simplifying the semaphore acquisition logic and updating all related method calls in code and tests. [1] [2] [3]

Outgoing message processing logic:

  • Refactored the outgoing message loop in ClientConnectionContext to use the new TryAcquire method, added retry logic with a timeout for pause handling, and improved cancellation handling during message processing.
  • Moved the message parsing loop inside the semaphore acquisition block to ensure proper pause handling and resource release. [1] [2]

Testing updates:

  • Updated the PauseHandlerTests to use the new method names and logic, ensuring the tests match the refactored API and behavior.

@vwxyzh vwxyzh enabled auto-merge (squash) October 28, 2025 07:50
@vwxyzh vwxyzh merged commit 42a4ccf into Azure:dev Oct 28, 2025
9 of 11 checks passed
@vwxyzh vwxyzh deleted the z/pause branch October 28, 2025 08:01
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.

3 participants