Skip to content

Commit c89e453

Browse files
committed
DOC: Mention that read() et al. already advance the read/write index
1 parent d78345b commit c89e453

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pa_ringbuffer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ def read_available(self):
131131
def write(self, data, size=-1):
132132
"""Write data to the ring buffer.
133133
134+
This advances the write index after writing;
135+
calling :meth:`advance_write_index` is *not* necessary.
136+
134137
:param data: Data to write to the buffer.
135138
:type data: CData pointer or buffer or bytes
136139
:param size: The number of elements to be written.
@@ -153,6 +156,9 @@ def write(self, data, size=-1):
153156
def read(self, size=-1):
154157
"""Read data from the ring buffer into a new buffer.
155158
159+
This advances the read index after reading;
160+
calling :meth:`advance_read_index` is *not* necessary.
161+
156162
:param size: The number of elements to be read.
157163
If not specified, all available elements are read.
158164
:type size: int, optional
@@ -171,6 +177,9 @@ def read(self, size=-1):
171177
def readinto(self, data):
172178
"""Read data from the ring buffer into a user-provided buffer.
173179
180+
This advances the read index after reading;
181+
calling :meth:`advance_read_index` is *not* necessary.
182+
174183
:param data: The memory where the data should be stored.
175184
:type data: CData pointer or buffer
176185

0 commit comments

Comments
 (0)