This sample shows how to use Temporal asyncio with Trio using Trio asyncio. Specifically it demonstrates using a traditional Temporal client and worker in a Trio setting, and how Trio-based code can run in both asyncio async activities and threaded sync activities.
For this sample, the optional trio_async
dependency group must be included. To include, run:
poetry install --with trio_async
To run, first see README.md for prerequisites. Then, run the following from this directory to start the worker:
poetry run python worker.py
This will start the worker. Then, in another terminal, run the following to execute the workflow:
poetry run python starter.py
The starter should complete with:
INFO:root:Workflow result: ['Hello, Temporal! (from asyncio)', 'Hello, Temporal! (from thread)']