def run(self):
        """
            Run relative threads and wait until they finish (due to error)
        """
        self._subscriber = ZmqSub(
            host=self.publisher_host,
            port=self.publisher_port,
            # handler=self._set_storage,
            topic='ps',
            deserializer=U.deserialize,
        )
        self._server = ZmqServer(
            host=self.serving_host,
            port=self.serving_port,
            # handler=self._handle_agent_request,
            serializer=U.serialize,
            deserializer=U.deserialize,
            bind=not self.load_balanced,
        )
        self._subscriber_thread = self._subscriber.start_loop(
            handler=self._set_storage,
            blocking=False)
        self._server_thread = self._server.start_loop(
            handler=self._handle_agent_request,
            blocking=False)
        print('Parameter server started')

        self._subscriber_thread.join()
        self._server_thread.join()

            Run relative threads and wait until they finish (due to error)
        
surreal/distributed/parameter_server.py