Connect two ThreadPools.

        The ``in_queue`` of the second pool will be set as the ``out_queue`` of
        the current pool, thus all the output will be input to the second pool.

        Args:
            component (ThreadPool): the ThreadPool to be connected.
        Returns:
            ThreadPool: the modified second ThreadPool.

def connect(self, component):
        """Connect two ThreadPools.

        The ``in_queue`` of the second pool will be set as the ``out_queue`` of
        the current pool, thus all the output will be input to the second pool.

        Args:
            component (ThreadPool): the ThreadPool to be connected.
        Returns:
            ThreadPool: the modified second ThreadPool.
        """
        if not isinstance(component, ThreadPool):
            raise TypeError('"component" must be a ThreadPool object')
        component.in_queue = self.out_queue
        return component