Skip to content

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

Closed

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

Activity

  1. thorwhalen commented on Oct 20, 2026

    @thorwhalen
    Member

    Landed in #31: BufferReader/mk_reader accept blocking= and timeout= defaults. Remaining: AudioBufferReader in audiostream2py (separate repo) should accept/forward the same kwargs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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