No project description provided
Project description
camunda-client
This package includes clients such as CamundaEngineClient and ExternalTaskClient
In addition, there is an ExternalTaskWorker for working with ExternalTask
Installing
pip
pip install camunda-client
pdm
pdm add camunda-client
ExternalTask functional usage
Source code in examples/external_task
from camunda_client.worker import ExternalTaskWorker
from .enums import WorkerEnum
async def subscribe(
topic: str,
task_worker: ExternalTaskWorker,
) -> None:
mapping = WorkerEnum.workers()
async with task_worker.subscribe(topic) as task_contexts:
async for task_context in task_contexts:
async with task_context as task_dto:
worker_cls = mapping[task_dto.topic_name]
# Resolve the dependency on the DI container.
# This initialization is provided as an example.
worker = worker_cls()
result = await worker.execute(task_dto)
if result.is_success is False:
print(f"Task with id {task_dto.id} was failed")
await task_context.fail(error_message=result.message)
else:
print(f"Task with id {task_dto.id} was completed")
await task_context.complete()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
camunda_client-0.5.11.tar.gz
(19.5 kB
view details)
Built Distribution
File details
Details for the file camunda_client-0.5.11.tar.gz
.
File metadata
- Download URL: camunda_client-0.5.11.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.18.1 CPython/3.11.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34515877a14fb05b5dbd1091f84dbece05b2bd02c5e41a2e2abee0d09e2806b6 |
|
MD5 | 623310eb92e13aa8993a7f566fe3ac14 |
|
BLAKE2b-256 | 7a48f271b9d153f79e3cc5aa498f8282bc55334eb66cf6217ba25f564e6f7f04 |
File details
Details for the file camunda_client-0.5.11-py3-none-any.whl
.
File metadata
- Download URL: camunda_client-0.5.11-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.18.1 CPython/3.11.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b74b8b9dd4ebc98a6c29aa20bc7251b27dfdd35e581504a0443b2c903d6b46 |
|
MD5 | 0697cdc6a76c89538a82ba94bdb22b53 |
|
BLAKE2b-256 | a729d27d01e96d3e2354831bcc2f2ae45c532f6c2ddaa9abab9c1fad7441651b |