mirror of
https://gricad-gitlab.univ-grenoble-alpes.fr/tienyoun/presentations.git
synced 2026-09-26 13:31:01 +00:00
add block diagrams for celery sse communication
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Celery
|
||||
<!-- .slide: data-background-image="./assets/celery.jpg" -->
|
||||
|
||||
https://gricad-gitlab.univ-grenoble-alpes.fr/tienyoun/presentations
|
||||
|
||||
<img src="./assets/celery.jpg">
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -131,6 +131,13 @@ https://docs.celeryq.dev/en/main/reference/celery.events.html
|
||||
|
||||
|
||||
|
||||
### Coté Worker
|
||||
- celery.events.EventDispatcher 📢
|
||||
- celery.events.EventReceiver 👂
|
||||
|
||||
|
||||
|
||||
|
||||
### Coté Worker
|
||||
<!-- .slide: data-auto-animate -->
|
||||
|
||||
@@ -187,10 +194,10 @@ class PtfTask(AbortableTask):
|
||||
```python
|
||||
@shared_task(name="crawler.tasks.toto", base=PtfTask, bind=True)
|
||||
def print_toto(self, toto = "toto"):
|
||||
|
||||
meta = {"current": 0, "total": len(toto)}
|
||||
# Initialize progress bar at 0
|
||||
self.update_state(
|
||||
meta={"current": index, "total": len(toto)},
|
||||
meta=meta,
|
||||
state=states.STARTED,
|
||||
)
|
||||
|
||||
@@ -199,8 +206,9 @@ def print_toto(self, toto = "toto"):
|
||||
print(letter)
|
||||
|
||||
# Update progress bar
|
||||
meta["current"] = index
|
||||
self.update_state(
|
||||
meta={"current": index, "total": len(toto)},
|
||||
meta=meta,
|
||||
state=states.STARTED,
|
||||
)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user