예제 #1
0
    def doit(self):
        msg = gs.message()
        msg["sender"] = "sender"
        msg["command"] = "start"
        msg["reply"] = self.msgfifo.name()
        msg["sub"] = gs.message('a', 'b', 'c')

        # Send to receiver
        try:
            print self.name(), ": sending a message to receiver: start"
            receiver = gs.findReceiver("Zreceiver")
            receiver.write(msg)
        except gs.BadReceiverName, e:
            print self.name(), ": invalid receiver:", e
            receiver = gs.findReceiver("receiver")
            receiver.write(msg)
예제 #2
0
    def doit(self):
        msg = gs.message(
          sender = "sender",
          configset = gs.message(
              cache = gs.message(size = 10),
              CPU = gs.message("adder", "multiplexor"),
          ),
          reply = self.msgfifo.name(),
        )

        # Send to receiver
        try:
            print self.name(), ": sending a message to receiver: start"
            receiver = gs.findReceiver("receiver")
            receiver.write(msg)
        except BadReceiverName, e:
            print self.name(), ": invalid receiver:", e.message
            return