Common: Make all methods of IEventQueue static

This commit is contained in:
Shreya Malviya 2022-08-05 18:51:07 +05:30
parent ac62281c84
commit 924fc3f1e2
1 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
from abc import ABC, abstractmethod from abc import ABC, abstractstaticmethod
from typing import Any, Callable, Sequence from typing import Any, Callable, Sequence
from common.events import AbstractEvent from common.events import AbstractEvent
@ -9,8 +9,8 @@ class IEventQueue(ABC):
Manages subscription and publishing of events Manages subscription and publishing of events
""" """
@abstractmethod @abstractstaticmethod
def subscribe_all(self, subscriber: Callable[..., Any]): def subscribe_all(subscriber: Callable[..., Any]):
""" """
Subscribes a subscriber to all events Subscribes a subscriber to all events
@ -19,8 +19,8 @@ class IEventQueue(ABC):
pass pass
@abstractmethod @abstractstaticmethod
def subscribe_types(self, types: Sequence[AbstractEvent], subscriber: Callable[..., Any]): def subscribe_types(types: Sequence[AbstractEvent], subscriber: Callable[..., Any]):
""" """
Subscribes a subscriber to all specifed event types Subscribes a subscriber to all specifed event types
@ -30,8 +30,8 @@ class IEventQueue(ABC):
pass pass
@abstractmethod @abstractstaticmethod
def subscribe_tags(self, tags: Sequence[str], subscriber: Callable[..., Any]): def subscribe_tags(tags: Sequence[str], subscriber: Callable[..., Any]):
""" """
Subscribes a subscriber to all specified event tags Subscribes a subscriber to all specified event tags
@ -41,8 +41,8 @@ class IEventQueue(ABC):
pass pass
@abstractmethod @abstractstaticmethod
def publish(self, event: AbstractEvent, data: Any): def publish(event: AbstractEvent, data: Any):
""" """
Publishes an event with the given data Publishes an event with the given data