Skip to content

Add hello sample for calling the client from synchronous code - #404

Open
HarrisJDCampbell wants to merge 1 commit into
temporalio:mainfrom
HarrisJDCampbell:add-sync-client-hello-sample
Open

HarrisJDCampbell wants to merge 1 commit into
temporalio:mainfrom
HarrisJDCampbell:add-sync-client-hello-sample

Conversation

@HarrisJDCampbell

@HarrisJDCampbell HarrisJDCampbell commented Oct 27, 2026 •

Copy link
Copy Markdown

Closes #231.

Add hello_sync_client.py to demonstrate calling the async client from synchronous code. greet() uses asyncio.run() to connect, execute a workflow, and return its result. A worker runs in the same process to keep the example standalone.

Create a new client for each call so it stays on the event loop that created it. Document that the wrapper requires a thread without a running event loop, and that applications making frequent calls should prefer a long-lived client and separate worker.

Add the sample to both README indexes and an integration test covering two consecutive calls.

Tested locally:

  • Integration test with local and time-skipping environments
  • Ruff lint, import order, and formatting
  • Mypy
  • git diff --check

Upstream CI failed before scheduling any jobs; full CI validation is pending.

@HarrisJDCampbell
HarrisJDCampbell requested review from a team as code owners October 27, 2026 04:53
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[Feature Request] Create sample for calling Python Client from a sync method

2 participants