diff --git a/MAC/Services/src/observation_control_rpc.py b/MAC/Services/src/observation_control_rpc.py index 48f3fecd75cd74f24234836319b12857f251cb2f..58fc05a1440a1ebb6fbef05ebfa7237651ce5364 100644 --- a/MAC/Services/src/observation_control_rpc.py +++ b/MAC/Services/src/observation_control_rpc.py @@ -20,7 +20,7 @@ import logging -from lofar.messaging.rpc_service import RPC, RPCContextManagerMixin +from lofar.messaging.rpc import RPCClient, RPCClientContextManagerMixin from lofar.mac.config import DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME ''' Simple RPC client for Service ObservationControl2 @@ -29,10 +29,10 @@ from lofar.mac.config import DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME logger = logging.getLogger(__name__) -class ObservationControlRPCClient(RPCContextManagerMixin): - def __init__(self, rpc : RPC = RPC(service_name=DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME)): +class ObservationControlRPCClient(RPCClientContextManagerMixin): + def __init__(self, rpc_client : RPCClient = RPCClient(service_name=DEFAULT_OBSERVATION_CONTROL_SERVICE_NAME)): super().__init__() - self._rpc = rpc + self._rpc_client = rpc_client def abort_observation(self, sas_id): - return self._rpc.execute('AbortObservation', sas_id=sas_id) + return self._rpc_client.execute('AbortObservation', sas_id=sas_id)