-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add the project_id attribute to tasks
- Loading branch information
Showing
21 changed files
with
796 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
from .app import AsyncApp | ||
from .task import Task, TaskError, TaskEvent, TaskResult, TaskStatus | ||
from .task_manager import TaskManager | ||
from .worker import Worker, WorkerConfig, WorkerType | ||
from .worker.neo4j import Neo4jWorker | ||
|
||
try: | ||
from icij_worker.worker.worker.amqp import AMQPWorker, AMQPWorkerConfig | ||
from icij_worker.event_publisher.amqp import AMQPPublisher | ||
except ImportError: | ||
pass | ||
|
||
try: | ||
from icij_worker.worker.neo4j_ import Neo4jWorker, Neo4jWorkerConfig | ||
from icij_worker.event_publisher.neo4j_ import Neo4jEventPublisher | ||
from icij_worker.task_manager.neo4j_ import Neo4JTaskManager | ||
except ImportError: | ||
pass | ||
|
||
from .backend import WorkerBackend | ||
from .event_publisher import EventPublisher, Neo4jEventPublisher | ||
from .event_publisher import EventPublisher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
from .event_publisher import EventPublisher | ||
|
||
try: | ||
from .neo4j import Neo4jEventPublisher | ||
except ImportError: | ||
pass | ||
|
||
try: | ||
from .amqp import AMQPPublisher | ||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
from abc import ABC, abstractmethod | ||
from typing import final | ||
|
||
from icij_worker import TaskEvent | ||
from icij_worker import Task, TaskEvent | ||
|
||
|
||
class EventPublisher(ABC): | ||
@final | ||
async def publish_event(self, event: TaskEvent, task: Task): | ||
event = event.with_project_id(task) | ||
await self._publish_event(event) | ||
|
||
@abstractmethod | ||
async def publish_event(self, event: TaskEvent, project: str): | ||
async def _publish_event(self, event: TaskEvent): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.