Skip to content

feat: add external storage concurrency limiter APIs - #615

Merged
jmaeagle99 merged 3 commits into
mainfrom
extstore-foundation
Oct 15, 2026
Merged

jmaeagle99 merged 3 commits into
mainfrom
extstore-foundation

Conversation

@jmaeagle99

@jmaeagle99 jmaeagle99 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Adds the concurrency contract for external storage drivers:

  • StorageDriverLimiter, with permit(item) { ... } holding a permit for the block.
  • ExternalStorageConcurrency, carrying the two budgets: max_driver_operations (64, shared
    across the configuration) and max_operations_per_message (8, per activation/task/request).
  • The limiter is now on StorageDriverStoreContext and StorageDriverRetrieveContext, and
    ExternalStorage takes a concurrency:.

Why?

A driver is handed a whole batch and decides for itself how many requests to make of it, so the SDK can only bound that fan out cooperatively by handing the driver something to take a permit from. The spec puts the limiter on the store and retrieve contexts and the budgets on the storage configuration.

Ruby's block form is the counterpart of Python's async with limiter.permit(item): — both hold the permit for a lexical scope and release it on exit, including when the body raises. Field names and defaults match Python's ExternalStorageConcurrency exactly. No cancellation parameter is needed because the Ruby contexts already carry a Cancellation.

Checklist

  1. How was this tested: New unit tests cover the defaults (64 / 8), rejection of non-positive and non-Integer budgets, and that permit runs the block and returns its value.

  2. Any docs updates needed? Not yet. Everything here is @!visibility private and experimental.

@jmaeagle99
jmaeagle99 requested a review from a team as a code owner October 12, 2026 18:00
@jmaeagle99 jmaeagle99 added the skip-changelog PR changes do not require changelog updates label Oct 12, 2026

@chris-olszewski chris-olszewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just small questions around some doc comment language

Comment thread temporalio/lib/temporalio/converters/storage_driver_limiter.rb Outdated
Comment thread temporalio/lib/temporalio/converters/storage_driver_limiter.rb Outdated
@jmaeagle99
jmaeagle99 enabled auto-merge (squash) October 15, 2026 04:02
@jmaeagle99
jmaeagle99 disabled auto-merge October 15, 2026 04:22
@jmaeagle99
jmaeagle99 enabled auto-merge (squash) October 15, 2026 04:26
@jmaeagle99
jmaeagle99 merged commit d5a171c into main Oct 15, 2026
11 checks passed
@jmaeagle99
jmaeagle99 deleted the extstore-foundation branch October 15, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR changes do not require changelog updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants