Skip to content

feat: Add scopes, flow-control limit keys and signals#207

Merged
slinkydeveloper merged 1 commit into
mainfrom
signals_and_scope
Jun 23, 2026
Merged

feat: Add scopes, flow-control limit keys and signals#207
slinkydeveloper merged 1 commit into
mainfrom
signals_and_scope

Conversation

@slinkydeveloper

@slinkydeveloper slinkydeveloper commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

New APIs

# Scopes and limit keys (same on ingress client)
fut = ctx.scope("tenant-123").service_call(MyService.handler, arg, limit_key="tenant-123/user42")
ctx.scope("tenant-123").workflow_send(MyWorkflow.run, key, arg)

# generic_call/generic_send with scope (same on ingress client)
ctx.generic_call(service, handler, payload, scope="tenant-123", limit_key="tenant-123/user42")
ctx.generic_send(service, handler, payload, scope="tenant-123")

# Read the inbound scope / limit key / idempotency key
ctx.request().scope
ctx.request().limit_key
ctx.request().idempotency_key

# Await a signal on the current invocation
value = await ctx.signal("approved", type_hint=str)

# Resolve / reject a signal on another invocation
ctx.resolve_signal(invocation_id, "approved", "yes")
ctx.reject_signal(invocation_id, "approved", "denied")

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Test Results

  8 files  ± 0    8 suites  ±0   3m 17s ⏱️ +24s
 60 tests +11   60 ✅ +11  0 💤 ±0  0 ❌ ±0 
267 runs  +51  267 ✅ +51  0 💤 ±0  0 ❌ ±0 

Results for commit 5d11d8d. ± Comparison against base commit 687a78b.

♻️ This comment has been updated with latest results.

@slinkydeveloper slinkydeveloper force-pushed the signals_and_scope branch 4 times, most recently from b7e0d62 to 88970de Compare June 23, 2026 10:09
Introduce ScopedContext via ctx.scope() carrying scope and optional
limit_key on calls/sends, and add SignalHandle for resolving/rejecting
named signals on target invocations (protocol V7). Expose scope and
limit_key on the invocation context and wire support through client,
server_context, vm and the Rust core. Bump shared core.
@slinkydeveloper slinkydeveloper merged commit 118a879 into main Jun 23, 2026
8 checks passed
@slinkydeveloper slinkydeveloper deleted the signals_and_scope branch June 23, 2026 10:31
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant