コード例 #1
0
ファイル: minimal_sender.py プロジェクト: zyuanfeng/Pyrlang
 def __init__(self, node):
     Process.__init__(self, node.node_name_, passive=False)
     self.node = node
     self.node_name = self.node.node_name_.split("@")[0]
     self.node.register_name(self, Atom(self.node_name))
     self.i = 0
     print("Registering process - {0}".format(self.node.node_name_))
コード例 #2
0
 def exit(self, reason=None):
     LOG.info("TestMonitorProcess: Received EXIT(%s)" % reason)
     node = self.get_node()
     #
     # 3. End, sending a stop message
     #
     LOG.info(color("Stopping remote loop", fg="red"))
     node.send(sender=self.pid_, receiver=remote_receiver_name(),
               message=(Atom("example5"), Atom("stop")))
     LOG.error("Done")
     Process.exit(self, reason)
コード例 #3
0
    def exit(self, reason=None):
        LOG.info("TestLinkProcess: Received EXIT(%s)" % reason)
        node = self.get_node()

        #
        # 2. Create a process P2
        #   Send pid of P2 to remote process example5 and it will monitor P3 and
        #   then will send an exit signal.
        #
        p2 = TestMonitorProcess()
        LOG.info("Sending {example5, test_monitor, %s} to remote 'example5'" % p2.pid_)
        node.send(sender=p2.pid_, receiver=remote_receiver_name(),
                  message=(Atom("example5"), Atom("test_monitor"), p2.pid_))

        Process.exit(self, reason)
コード例 #4
0
 def exit(self, reason=None):
     logging.error(reason)
     Process.exit(self, reason)
コード例 #5
0
 def __init__(self, node) -> None:
     Process.__init__(self, node_name=node.node_name_)
     node.register_name(self, Atom('mailbox'))
コード例 #6
0
 def __init__(self) -> None:
     Process.__init__(self)
     self.get_node().register_name(self, Atom('my_process'))  # optional
     LOG.info("Registering process - 'my_process'")
コード例 #7
0
 def __init__(self) -> None:
     Process.__init__(self)
コード例 #8
0
 def exit(self, reason=None):
     #
     # 1.2. Exiting remote linked process should also exit this process
     #
     LOG.info("LinkExample6: Received EXIT(%s)" % reason)
     Process.exit(self, reason)
コード例 #9
0
 def __init__(self, node) -> None:
     Process.__init__(self, node_name=node.node_name_)
コード例 #10
0
ファイル: test.py プロジェクト: rizki96/bridge_demo
    def exit(self, reason=None):
        LOG.info("MyProcess: Received EXIT(%s)" % reason)
        #node = self.get_node()

        Process.exit(self, reason)
コード例 #11
0
 def __init__(self, node) -> None:
     Process.__init__(self, node_name=node.node_name_)
     node.register_name(self, Atom('my_process'))  # optional
     LOG.info("Registering process - 'my_process'")