def link(self, source, sink, *optionalargs, **kwoptionalargs): """\ link((component,boxname),(component,boxname),**otherargs) -> new linkage Creates a linkage from a named box on one component to a named box on another. See linkage class for meanings of other arguments. A linkage object is returned as a handle representing the linkage created. The linkage is registered with this postoffice. Throws Axon.AxonExceptions.BoxAlreadyLinkedToDestination if the source is already linked to somewhere else (Axon does not permit one-to-many). """ (sourcecomp, sourcebox) = source (sinkcomp, sinkbox) = sink thelink = linkage(sourcecomp,sinkcomp,sourcebox,sinkbox,*optionalargs,**kwoptionalargs) try: thelink.getSinkbox().addsource( thelink.getSourcebox() ) except BoxAlreadyLinkedToDestination, e: raise e
def __init__(self): super(testComponent, self).__init__() self.lackofinterestingthingscount = 0 self.total = 0 self.producer, self.consumer =Producer(), Consumer() self.producer2, self.consumer2 = Producer(), Consumer() self.addChildren(self.producer, self.producer2, self.consumer, self.consumer2) self.link((self.producer, "result"), (self.consumer, "source")) linkage(self.producer2, self.consumer2, "result", "source", self.postoffice) linkage(self.consumer,self,"result","_output", self.postoffice) linkage(self.consumer2,self,"result","_output", self.postoffice)
def link(self, source, sink, *optionalargs, **kwoptionalargs): """\ link((component,boxname),(component,boxname),**otherargs) -> new linkage Creates a linkage from a named box on one component to a named box on another. See linkage class for meanings of other arguments. A linkage object is returned as a handle representing the linkage created. The linkage is registered with this postoffice. Throws Axon.AxonExceptions.BoxAlreadyLinkedToDestination if the source is already linked to somewhere else (Axon does not permit one-to-many). """ (sourcecomp, sourcebox) = source (sinkcomp, sinkbox) = sink thelink = linkage(sourcecomp, sinkcomp, sourcebox, sinkbox, *optionalargs, **kwoptionalargs) try: thelink.getSinkbox().addsource(thelink.getSourcebox()) except BoxAlreadyLinkedToDestination, e: raise e
def __init__(self): super(testComponent, self).__init__() self.lackofinterestingthingscount = 0 self.total = 0 self.producer, self.consumer = Producer(), Consumer() self.producer2, self.consumer2 = Producer(), Consumer() self.addChildren(self.producer, self.producer2, self.consumer, self.consumer2) self.link((self.producer, "result"), (self.consumer, "source")) linkage(self.producer2, self.consumer2, "result", "source", self.postoffice) linkage(self.consumer, self, "result", "_output", self.postoffice) linkage(self.consumer2, self, "result", "_output", self.postoffice)