REST API Client for Camunda 7
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.11.2.tar.gz
(22.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camunda_client-0.11.2.tar.gz.
File metadata
- Download URL: camunda_client-0.11.2.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.0 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c069bf52ebd591c8831326891b15787599c60f78fb66cec7ec7083eb206fe31b
|
|
| MD5 |
f2f38f888ca0c04939bcd4eb8ca5c6e0
|
|
| BLAKE2b-256 |
8d5f17bfdd56bd0abfb74d36b9bb99401da6b1dc4c17fcf663952efa3a9dbc46
|
File details
Details for the file camunda_client-0.11.2-py3-none-any.whl.
File metadata
- Download URL: camunda_client-0.11.2-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.0 CPython/3.11.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a9622e88ddefb20c6f747c22cbdf9593ceb26625985da0f2ee2b6c76d794b7
|
|
| MD5 |
196c1366fabc55a287b114a5f75f8384
|
|
| BLAKE2b-256 |
74a76d938fe74f3122737fc2d9a6bc7630f4d2f975c783712f324f96a6d73ea9
|