Exemplo n.º 1
0
Arquivo: node.py Projeto: gbour/twotp
 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))
Exemplo n.º 2
0
Arquivo: node.py Projeto: gbour/twotp
 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))
Exemplo n.º 3
0
Arquivo: node.py Projeto: gbour/twotp
 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))
Exemplo n.º 4
0
Arquivo: node.py Projeto: gbour/twotp
 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))
Exemplo n.º 5
0
Arquivo: node.py Projeto: gbour/twotp
 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))
Exemplo n.º 6
0
Arquivo: node.py Projeto: gbour/twotp
    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))
Exemplo n.º 7
0
Arquivo: node.py Projeto: gbour/twotp
    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
Exemplo n.º 8
0
Arquivo: node.py Projeto: gbour/twotp
 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))