forked from p15670423/monkey
Common: Change IEventQueue and PyPubSubEventQueue's subscribe_tags() -> subscribe_tag()
This commit is contained in:
parent
e92d67bfe8
commit
ae666d3dd3
|
@ -33,11 +33,11 @@ class IEventQueue(ABC):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractstaticmethod
|
@abstractstaticmethod
|
||||||
def subscribe_tags(tags: Sequence[str], subscriber: Callable[[AbstractEvent], None]):
|
def subscribe_tag(tag: str, subscriber: Callable[[AbstractEvent], None]):
|
||||||
"""
|
"""
|
||||||
Subscribes a subscriber to all specified event tags
|
Subscribes a subscriber to the specified event tag
|
||||||
|
|
||||||
:param tags: Event tags to which the subscriber should subscribe
|
:param tag: Event tag to which the subscriber should subscribe
|
||||||
:param subscriber: Callable that should subscribe to events
|
:param subscriber: Callable that should subscribe to events
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,7 @@ class PyPubSubEventQueue(IEventQueue):
|
||||||
pub.subscribe(listener=subscriber, topicName=event_type_name)
|
pub.subscribe(listener=subscriber, topicName=event_type_name)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def subscribe_tags(tags: Sequence[str], subscriber: Callable[[AbstractEvent], None]):
|
def subscribe_tag(tag: str, subscriber: Callable[[AbstractEvent], None]):
|
||||||
for tag in tags:
|
|
||||||
pub.subscribe(listener=subscriber, topicName=tag)
|
pub.subscribe(listener=subscriber, topicName=tag)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue