from __future__ import annotations

class SharedBytesRingBufferProducer:
    """Shared-memory SPSC producer for bytes payloads."""

    def __init__(
        self,
        path: str,
        capacity_bytes: int,
        *,
        create: bool = True,
        unlink_on_close: bool = False,
        spin_wait: int = 1024,
    ) -> None: ...
    def close(self) -> None: ...
    def insert(self, item: bytes) -> bool: ...
    def insert_char(
        self, data: bytes, n: int
    ) -> bool: ...  # Cython-only: takes const char* and size_t
    def insert_batch(self, items: list[bytes]) -> bool: ...
    def insert_packed(self, items: list[bytes]) -> bool: ...

class SharedBytesRingBufferConsumer:
    """Shared-memory SPSC consumer for bytes payloads."""

    def __init__(self, path: str, *, spin_wait: int = 1024) -> None: ...
    def consume(self) -> bytes: ...
    def peekleft(self) -> bytes | None: ...
    def peekright(self) -> bytes | None: ...
    def consume_all(self) -> list[bytes]: ...
    def consume_packed(self) -> list[bytes]: ...
