def send(self, proto, destPid, msg): """ Common routine to reply to a request. """ cookie = Atom('') ctrlMsg = Tuple((Integer(self.CTRLMSGOP_SEND), cookie, destPid)) proto.send("p" + termToBinary(ctrlMsg) + termToBinary(msg))
def namedSend(self, proto, pid, processName, msg): """ Send a message to a named process. """ cookie = Atom('') ctrlMsg = Tuple( (Integer(self.CTRLMSGOP_REG_SEND), pid, cookie, processName)) proto.send("p" + termToBinary(ctrlMsg) + termToBinary(msg))
def sendLinkExit(self, proto, srcPid, destPid, reason): """ Send an exit signal for a remote linked process. """ ctrlMsg = Tuple( (Integer(self.CTRLMSGOP_EXIT), srcPid, destPid, reason)) proto.send("p" + termToBinary(ctrlMsg))
def sendUnlink(self, proto, srcPid, destPid): """ Remove a previously created link between local PID C{srcPid} to remote PID C{destPid}. """ ctrlMsg = Tuple((Integer(self.CTRLMSGOP_UNLINK), srcPid, destPid)) proto.send("p" + termToBinary(ctrlMsg))
def sendMonitorExit(self, proto, srcPid, destPid, monitorRef, reason): """ Send a monitor exit signal for a remote process. """ ctrlMsg = Tuple( (Integer(self.CTRLMSGOP_MONITOR_P_EXIT), srcPid, destPid, monitorRef, reason)) proto.send("p" + termToBinary(ctrlMsg))
def sendDemonitor(self, proto, srcPid, destPid, monitorRef): """ Remove monitoring of remote process C{destPid}. @return: the L{Reference} of the monitoring, which will be passed in exit. """ ctrlMsg = Tuple( (Integer(self.CTRLMSGOP_DEMONITOR_P), srcPid, destPid, monitorRef)) proto.send("p" + termToBinary(ctrlMsg))
def sendMonitor(self, proto, srcPid, destPid): """ Monitor remote PID C{destPid}. @return: the L{Reference} of the monitoring, which will be passed in exit. """ monitorRef = self.createRef() ctrlMsg = Tuple( (Integer(self.CTRLMSGOP_MONITOR_P), srcPid, destPid, monitorRef)) proto.send("p" + termToBinary(ctrlMsg)) return monitorRef
def sendLink(self, proto, srcPid, destPid): """ Create a link from local PID C{srcPid} to remote PID C{destPid}. """ ctrlMsg = Tuple((Integer(self.CTRLMSGOP_LINK), srcPid, destPid)) proto.send("p" + termToBinary(ctrlMsg))