💥 feat(sdk): enforce some activity to close timeout is set#1221
Merged
chris-olszewski merged 6 commits intomasterfrom Apr 20, 2026
Merged
💥 feat(sdk): enforce some activity to close timeout is set#1221chris-olszewski merged 6 commits intomasterfrom
chris-olszewski merged 6 commits intomasterfrom
Conversation
720d798 to
39801f1
Compare
Sushisource
approved these changes
Apr 17, 2026
Member
Sushisource
left a comment
There was a problem hiding this comment.
Nice! This is a big improvement.
e2990dd to
1891c4b
Compare
ca4cded to
979ad37
Compare
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
ActivityOptionsschedule_to_close_timeoutandstart_to_close_timeoutinto a combined field ofclose_timeouts: ActivityCloseTimeoutsto enforce that some timeout to close is set.Aside from the vanilla builder we add a few methods to help with ergonomics by letting them skip importing the new enum:
ActivityOptions::schedule_to_close_timeout/ActivityOptions::start_to_close_timeout: Directly construct activity options with just this timeout setActivityOptions::with_schedule_to_close_timeout/ActivityOptions::with_start_to_close_timeout: Start an options builder with one of these timeouts setThere is no both variant for these since it would take 2
Durationobjects and there isn't a clear way to indicate which one is for which timeout without a struct, which we already have this with the enum.Why?
Collapsing the close timeouts allows us to enforce that all activities must have a timeout to close.
I ended up combining this with moving
ActivityOptionsto a builder as the close timeout change was invasive enough and at the end of the day I wanted to see the end state of how we want users to construct these options.Alternatives Considered
There is a nice design where we continue to expose the activity timeout setting only via the builder with
.start_to_close_timeoutandschedule_to_close_timeoutsetters that both flow into a single required field.elastio/bon#149
Checklist
Closes N/A
How was this tested:
Migrated existing tests/examples to use new activity options API
Any docs updates needed?
README was updated