Skip to main content

No project description provided

Project description

Celery service task

Classe permettant d'implémenter une tâche pour un worker Celery spécifique

Usage

# import
from celery_service_task.task import TaskBase

# implémentation d'une tâche simple
class Task(TaskBase):
  def task(self) -> bool:
    print(self.conf) # la configuration est donnée par le worker Celery
    print(self.payload) # le payload est déjà sous forme d'un dictionnaire
    print(self.t_id) # identifiant de la transaction issue du payload



# utilisation de la class créée
t = Task(
    payload={'transaction_id': '123', 'hello': 'world'},
    conf={}
)

t.run_task() # lance la tâche si l'id de transaction n'est pas déjà enregistré 

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

celery_service_task-0.1.0.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

celery_service_task-0.1.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

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