def get_chunk()

in amazon_transcribe/httpsession.py [0:0]


    def get_chunk(self) -> Awaitable[bytes]:
        with self._chunk_lock:
            future: Future[bytes] = Future()
            # TODO: update backpressure window
            if self._received_chunks:
                chunk = self._received_chunks.pop(0)
                future.set_result(chunk)
            elif self._stream.completion_future.done():
                future.set_result(b"")
            else:
                self._chunk_futures.append(future)
            return asyncio.wrap_future(future)