Skip to main content

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


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.12.1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

camunda_client-0.12.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file camunda_client-0.12.1.tar.gz.

File metadata

  • Download URL: camunda_client-0.12.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.0 CPython/3.11.9 Windows/10

File hashes

Hashes for camunda_client-0.12.1.tar.gz
Algorithm Hash digest
SHA256 1154d4ff4bf15dc0f5cbb24fb12fdb6aca937bfae377912ba83f2ebb562b7402
MD5 9ab4706cbfe43ed3d6ce3f2f60630282
BLAKE2b-256 17abe5e11dd3eac3da00e3e19d6161392aaf0776b0610d29473c26cef8b749ae

See more details on using hashes here.

File details

Details for the file camunda_client-0.12.1-py3-none-any.whl.

File metadata

  • Download URL: camunda_client-0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.0 CPython/3.11.9 Windows/10

File hashes

Hashes for camunda_client-0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7cd33710ba67a96bb829cae9cb6cd987c76783f60e0ad8055ce2b5fe72a89580
MD5 f2d4993ed0ab9a8fb1103c0f39f1e155
BLAKE2b-256 80c0b5b676a5b92c42ea31c53ae387ef8c13f7de3ddb1c74b88f48ab430edca3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page