Skip to content

[Brook] Added generic calls from Python to a worker extension. - #324

Closed
moetemp wants to merge 2 commits into
moe/brook/v3/p1-worker-extensionfrom
moe/brook/v3/p2-extension-call
Closed

moetemp wants to merge 2 commits into
moe/brook/v3/p1-worker-extensionfrom
moe/brook/v3/p2-extension-call

Conversation

@moetemp

@moetemp moetemp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR adds WorkerExtension.call(method, input) and await WorkerExtension.call_async(method, input). They reach the extension's call and call_async in Core's WorkerExtension trait. A failed call raises temporalio.worker.ExtensionError with the gRPC code, the message and the encoded details.

Why?

Lang code must reach the same extension that Core calls, and that extension is in the same native library. A call with a method name and encoded input keeps the bridge free of code for one extension. Workflow code uses the synchronous call at the end of an Activation, and Activities and clients use the async one.

How did you test it?

pytest tests/worker/test_extension.py, with the debug-only test extension.

  • Unit Tests
  • Staging
  • End to End Tests

Lang code must reach the extension that Core calls, in the same native library. A call by method name with encoded input keeps the bridge free of code for one extension. A failed call raises ExtensionError with the gRPC code and details.
@moetemp

moetemp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This layer is folded into the v5 tip, #365, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f

@moetemp moetemp closed this Oct 25, 2026
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.

1 participant