forked from p15670423/monkey
Common: Remove unsubscribing methods from IEventQueue and EventQueue
This commit is contained in:
parent
77ea3e554d
commit
f3ef99db64
|
@ -35,19 +35,3 @@ class EventQueue(IEventQueue):
|
|||
# publish to tags' topics
|
||||
for tag in event.tags:
|
||||
pub.sendMessage(tag, **data)
|
||||
|
||||
@staticmethod
|
||||
def unsubscribe_all(subscriber: Callable[..., Any]):
|
||||
pub.unsubscribe(listener=subscriber, topicName=pub.ALL_TOPICS)
|
||||
|
||||
@staticmethod
|
||||
def unsubscribe_types(types: Sequence[AbstractEvent], subscriber: Callable[..., Any]):
|
||||
for event_type in types:
|
||||
# pypubsub.pub.subscribe needs a string as the topic/event name
|
||||
event_type_name = event_type.__name__
|
||||
pub.unsubscribe(listener=subscriber, topicName=event_type_name)
|
||||
|
||||
@staticmethod
|
||||
def unsubscribe_tags(tags: Sequence[str], subscriber: Callable[..., Any]):
|
||||
for tag in tags:
|
||||
pub.unsubscribe(listener=subscriber, topicName=tag)
|
||||
|
|
|
@ -51,35 +51,3 @@ class IEventQueue(ABC):
|
|||
"""
|
||||
|
||||
pass
|
||||
|
||||
@abstractstaticmethod
|
||||
def unsubscribe_all(subscriber: Callable[..., Any]):
|
||||
"""
|
||||
Unsubscribes a subscriber from all events
|
||||
|
||||
: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
|
||||
|
|
Loading…
Reference in New Issue