feat: abstract base classes for endpoints

Introduces EndpointBase and ReceiverBase abstract base classes. Implements a ReceiverBase with the MainReceiver.

ref: N25B-168
This commit is contained in:
Twirre Meulenbelt
2025-10-09 16:04:18 +02:00
parent c4530f0c3a
commit 23805812d5
6 changed files with 201 additions and 42 deletions

View File

@@ -0,0 +1,21 @@
from abc import ABCMeta, abstractmethod
from robot_interface.endpoints.endpoint_base import EndpointBase
class ReceiverBase(EndpointBase, object):
"""Associated with a ZeroMQ socket."""
__metaclass__ = ABCMeta
@abstractmethod
def handle_message(self, message):
"""
Handle a message with the receiver.
:param message: The message to handle.
:type message: dict
:return: A response message.
:rtype: dict
"""
return {"endpoint": "error", "data": "The requested receiver is not implemented."}