Skip to content

update the design doc with the threading details#211

Open
zhongkechen wants to merge 2 commits intomainfrom
design
Open

update the design doc with the threading details#211
zhongkechen wants to merge 2 commits intomainfrom
design

Conversation

@zhongkechen
Copy link
Contributor

@zhongkechen zhongkechen commented Mar 13, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#184

Description

Updated the threading section in design doc

Demo/Screenshots

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

Integration Tests

Have integration tests been written for these changes?

Examples

Has a new example been added for the change? (if applicable)

@zhongkechen zhongkechen marked this pull request as ready for review March 13, 2026 21:47
@zhongkechen zhongkechen requested a review from a team March 13, 2026 21:47
ayushiahjolia
ayushiahjolia previously approved these changes Mar 13, 2026
#### 2. Suspension Detection - Unified Thread Counting
We use thread counting as the suspension trigger because threads naturally deregister when they cannot make progress on durable operations. This provides a simple, unified mechanism that works across all operation types.
`runUntilCompleteOrSuspend` uses `CompletableFuture.anyOf(userFuture, executionExceptionFuture)`:
- If `handlerFuture` completes first → `SUCCESS` (or `FAILED` if the handler threw).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be userFuture?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handlerFuture is correct. Updated the above.

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