cnheider / samples-python

Samples for working with the Temporal Python SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Temporal Python SDK Samples

This is the set of Python samples for the Python SDK.

Usage

Prerequisites:

With this repository cloned, run the following at the root of the directory:

poetry install

That loads all required dependencies. Then to run a sample, usually you just run it in Python. For example:

poetry run python hello/hello_activity.py

Some examples require extra dependencies. See each sample's directory for specific instructions.

Samples

  • activity_sticky_queue - Uses unique task queues to ensure activities run on specific workers.
  • activity_worker - Use Python activities from a workflow in another language.
  • custom_converter - Use a custom payload converter to handle custom types.
  • custom_decorator - Custom decorator to auto-heartbeat a long-running activity.
  • encryption - Apply end-to-end encryption for all input/output.
  • open_telemetry - Trace workflows with OpenTelemetry.
  • patching - Alter workflows safely with patch and deprecate_patch.
  • polling - Recommended implementation of an activity that needs to periodically poll an external resource waiting its successful completion.
  • prometheus - Configure Prometheus metrics on clients/workers.
  • pydantic_converter - Data converter for using Pydantic models.
  • schedules - Demonstrates a Workflow Execution that occurs according to a schedule.
  • sentry - Report errors to Sentry.

Test

Running the tests requires poe to be installed.

python -m pip install poethepoet

Once you have poe installed you can run:

poe test

About

Samples for working with the Temporal Python SDK

License:MIT License


Languages

Language:Python 98.9%Language:Go 1.1%