From 0578a6fcc8b019cb416226d7792ce238b0c6b4f1 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 8 Aug 2022 13:38:27 +0530 Subject: [PATCH] Common: Add unsubscribing functions to IEventQueue --- monkey/common/event_queue/i_event_queue.py | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/monkey/common/event_queue/i_event_queue.py b/monkey/common/event_queue/i_event_queue.py index 03689b814..af4c1332d 100644 --- a/monkey/common/event_queue/i_event_queue.py +++ b/monkey/common/event_queue/i_event_queue.py @@ -52,5 +52,34 @@ class IEventQueue(ABC): pass + @abstractstaticmethod + def unsubscribe_all(subscriber: Callable[..., Any]): + """ + Unsubscribes a subscriber from all events -# TODO: Add unsubscribing functions + :param subscriber: Callable that should unsubscribe from events + """ + + pass + + @abstractstaticmethod + def unsubscribe_types(types: Sequence[AbstractEvent], subscriber: Callable[..., Any]): + """ + Unsubscribes a subscriber from all specifed event types + + :param types: Event types from which the subscriber should unsubscribe + :param subscriber: Callable that should unsubscribe from events + """ + + pass + + @abstractstaticmethod + def unsubscribe_tags(tags: Sequence[str], subscriber: Callable[..., Any]): + """ + Unubscribes a subscriber from all specified event tags + + :param tags: Event tags from which the subscriber should unsubscribe + :param subscriber: Callable that should unsubscribe from events + """ + + pass