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
Built Distribution
Close
Hashes for celery_service_task-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04c6a8a9639a6bc2673638b4b4a86cd2f84edfdcbfb265dbf95de8a2735d8942 |
|
MD5 | 574eca8815ee21563c3ce258dde1f856 |
|
BLAKE2b-256 | cdb1486862c7adc9d193103d8a844ccd18f981149836a4e0b510065a2eba09b6 |
Close
Hashes for celery_service_task-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f82d67112174012f7310526e1f68588dc94b789bca586413b490a2a973e88e5 |
|
MD5 | 3499c910a243f8cf07b65fb23a39aa8b |
|
BLAKE2b-256 | ba185c7dd81e07d21c46d0b783be5e393a64c1fba4d81d2a7fb4ff1886712b5c |