def add_endpoint(self, listener):
        """
        Adds a listening endpoint to be managed by this ION process.

        Spawns the listen loop and sets the routing call to synchronize incoming messages
        here. If this process hasn't been started yet, adds it to the list of listeners
        to start on startup.
        """
        if self.proc:
            listener.routing_call           = self._routing_call

            if self.name:
                svc_name = "unnamed-service"
                if self.service is not None and hasattr(self.service, 'name'):
                    svc_name = self.service.name

                listen_thread_name          = (svc_name, self.name, len(self.listeners)+1) % "%s-%s-listen-%s"
            else:
                listen_thread_name          = "unknown-listener-%s" % (len(self.listeners)+1)

            gl = self.thread_manager.spawn(listener.listen, thread_name=listen_thread_name)
            gl.proc._glname = "ION Proc listener %s" % listen_thread_name
            self._listener_map[listener] = gl
            self.listeners.append(listener)
        else:
            self._startup_listeners.append(listener)
dataset/ETHPy150Open ooici/pyon/pyon/ion/process.py/IonProcessThread.add_endpoint/swapped operands of `%`