+ def setSuspend(self, suspended):
+ changed = self.__suspended != suspended
+ if not self.__suspended and suspended:
+ self.doSuspend(1)
+ elif self.__suspended and not suspended:
+ self.doSuspend(0)
+
+ self.__suspended = suspended
+ if self.source is not None and changed:
+ self.source.checkSuspend()
+
+ suspended = property(lambda self: self.__suspended, setSuspend)
+
+ def checkSuspend(self):
+ self.suspended = reduce(lambda x, y: x and y.__suspended, self.downstream_elements, True)
+
+ def doSuspend(self, suspend):
+ pass