Skip to content

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

@andeaseme

Description

@andeaseme

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions