Пример #1
0
    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)
Пример #2
0
    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()
Пример #3
0
    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)
Пример #4
0
    def make_route_bot(self, 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 = queue.DataQueue()
            self.start_q.append(q_i)
            BotFrame.make_bot(q_i, q_o, func)
Пример #5
0
    def make_route_bot(self, iq, oq):

        self.start_q = []
        self.tmp_output_q = []
        self.output_q = oq
        self.share = False
        self.joined = True
        self.route_type = [object]

        self.start_index = len(BotFrame.bots)
        for func in self.args:

            i_q = asyncio.Queue(maxsize=1)
            o_q = queue.DataQueue()
            self.start_q.append(i_q)
            self.tmp_output_q.append(o_q)
            BotFrame.make_bot(i_q, o_q, func)

        self.end_index = len(BotFrame.bots)
Пример #6
0
    def make_route_bot(self, oq):

        self.start_q = []
        self.output_q = oq
        self.inner_output_q = queue.DataQueue()
        self.share = False
        self.joined = True
        self.route_type = [object]
        self.joined_result = {}
        self.start_index = len(BotFrame.bots)
        for func in self.args:

            i_q = asyncio.Queue(maxsize=1)
            self.start_q.append(i_q)
            BotFrame.make_bot(i_q, self.inner_output_q, func)

        BotFrame.make_bot(self.inner_output_q,
                          self.output_q,
                          self.join_merge,
                          raw_bdata=True)

        self.end_index = len(BotFrame.bots)