Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to make BufferReader blocking to wait for future data. #20

Open
andeaseme opened this issue Mar 11, 2023 · 0 comments
Open

Comments

@andeaseme
Copy link
Member

andeaseme commented Mar 11, 2023

We often prefer to wait for requested data.

class BufferReader:
    def __init__(
        self,
        buffer: RWLockSortedDeque,
        source_reader_info: dict,
        stop_event: threading.Event,
        *,
        blocking=False,  # <----  Add this
        read_size=1,
        peek=False,
        strict_n=False,
        ignore_no_item_found=False,
    ):
        ...

reader = stream_buffer.mk_reader(blocking=True). #  <---- Allow this

also update AudioBufferReader in audiostream2py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant