def __init__(self, *args): q_o = queue.GodQueue() # get this pip own inside bot self.start_index = len(BotFrame.bots) self.q_start = q_o self.joined = False for func in args: q_i = q_o if func == args[-1]: q_o = queue.NullQueue() else: if config.replay_mode: q_o = queue.CachedQueue() else: q_o = queue.DataQueue() bis = BotFrame.make_bot(q_i, q_o, func) for b in bis: b.flow = 'main' if isinstance(func, Route): if hasattr(func, 'joined') and func.joined: self.joined = True self.end_index = len(BotFrame.bots) for i in range(self.start_index, self.end_index): BotFrame.bots[i].pipeline = str(self) self.q_end = q_o if self.joined or config.joined_network: self.check_joined_node()
def make_route_bot(self, iq, oq): if self.joined: q_o = oq else: q_o = queue.NullQueue() self.start_q = [] self.output_q = oq #parallel in sub network not in node for func in self.args: q_i = asyncio.Queue() self.start_q.append(q_i) BotFrame.make_bot(q_i, q_o, func)
def make_route_bot(self, iq, oq): self.output_q = oq q_o = queue.DataQueue() self.start_q = [q_o] for func in self.args: q_i = q_o if self.is_last_one(self.args, func): if self.joined: q_o = oq else: q_o = queue.NullQueue() else: q_o = queue.DataQueue() BotFrame.make_bot(q_i, q_o, func)
def make_route_bot(self, oq): q_o = queue.DataQueue() self.start_q = [q_o] self.output_q = oq # if self.share: # self.start_q.append(oq) for idx, func in enumerate(self.args): q_i = q_o if idx == len(self.args) - 1: if self.joined: q_o = self.output_q else: q_o = queue.NullQueue() else: q_o = queue.DataQueue() BotFrame.make_bot(q_i, q_o, func)
def make_route_bot(self, oq): self.start_q = [oq] self.output_q = queue.NullQueue()