diff --git a/src/robot_interface/endpoints/receiver_base.py b/src/robot_interface/endpoints/receiver_base.py index 35f933e..b3183f7 100644 --- a/src/robot_interface/endpoints/receiver_base.py +++ b/src/robot_interface/endpoints/receiver_base.py @@ -1,9 +1,9 @@ from abc import ABCMeta, abstractmethod -from robot_interface.endpoints.endpoint_base import EndpointBase +from robot_interface.endpoints.socket_base import SocketBase -class ReceiverBase(EndpointBase, object): +class ReceiverBase(SocketBase, object): """Associated with a ZeroMQ socket.""" __metaclass__ = ABCMeta diff --git a/src/robot_interface/endpoints/endpoint_base.py b/src/robot_interface/endpoints/socket_base.py similarity index 97% rename from src/robot_interface/endpoints/endpoint_base.py rename to src/robot_interface/endpoints/socket_base.py index 54ebf1c..a5124f6 100644 --- a/src/robot_interface/endpoints/endpoint_base.py +++ b/src/robot_interface/endpoints/socket_base.py @@ -1,7 +1,7 @@ from abc import ABCMeta -class EndpointBase(object): +class SocketBase(object): __metaclass__ = ABCMeta name = None diff --git a/src/robot_interface/main.py b/src/robot_interface/main.py index 11cb761..a295484 100644 --- a/src/robot_interface/main.py +++ b/src/robot_interface/main.py @@ -14,11 +14,11 @@ def main_loop(context): :param context: The ZeroMQ context to use. :type context: zmq.Context """ - # When creating endpoints, remember to add them to the endpoint list of the state to ensure they're deinitialized + # When creating sockets, remember to add them to the `sockets` list of the state to ensure they're deinitialized main_receiver = MainReceiver(context) state.endpoints.append(main_receiver) - # Define endpoints that can run on the main thread. These endpoints should not block for long (say 50 ms at most). + # Sockets that can run on the main thread. These sockets' endpoints should not block for long (say 50 ms at most). receivers = [main_receiver] poller = zmq.Poller() diff --git a/src/robot_interface/state.py b/src/robot_interface/state.py index 30d6a0f..d10cf77 100644 --- a/src/robot_interface/state.py +++ b/src/robot_interface/state.py @@ -14,7 +14,7 @@ class State(object): def __init__(self): self.is_initialized = False self.exit_event = None - self.endpoints = [] # type: List[EndpointBase] + self.sockets = [] # type: List[SocketBase] def initialize(self): if self.is_initialized: @@ -33,8 +33,8 @@ class State(object): def deinitialize(self): if not self.is_initialized: return - for endpoint in self.endpoints: - endpoint.close() + for socket in self.sockets: + socket.close() self.is_initialized = False