mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-27 13:47:50 +02:00
* Add review item data transmission * Publish review updates * Add review item subscriber * Basic implementation for testing review processor * Formatting
31 lines
721 B
Python
31 lines
721 B
Python
"""Facilitates communication between processes."""
|
|
|
|
import logging
|
|
|
|
from .zmq_proxy import Publisher, Subscriber
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ReviewDataPublisher(
|
|
Publisher
|
|
): # update when typing improvement is added Publisher[tuple[str, float]]
|
|
"""Publishes review item data."""
|
|
|
|
topic_base = "review/"
|
|
|
|
def __init__(self, topic: str) -> None:
|
|
super().__init__(topic)
|
|
|
|
def publish(self, payload: tuple[str, float], sub_topic: str = "") -> None:
|
|
super().publish(payload, sub_topic)
|
|
|
|
|
|
class ReviewDataSubscriber(Subscriber):
|
|
"""Receives review item data."""
|
|
|
|
topic_base = "review/"
|
|
|
|
def __init__(self, topic: str) -> None:
|
|
super().__init__(topic)
|