def generator(self):
    while (not self.closed):
        chunk = self._buff.get()
        if (chunk is None):
            return
        data = [chunk]
        while True:
            try:
                chunk = self._buff.get(block=False)
                if (chunk is None):
                    return
                data.append(chunk)
            except Empty:
                break
        (yield b''.join(data))
def generator(self):
    while (not self.closed):
        chunk = self._buff.get()
        if (chunk is None):
            return
        data = [chunk]
        while True:
            try:
                chunk = self._buff.get(block=False)
                if (chunk is None):
                    return
                data.append(chunk)
            except Empty:
                break
        (yield b.join(data))