Repository: apify/crawlee-python
File: src/crawlee/storage_clients/_file_system/_request_queue_client.py (Python)

Code before:
        lock: asyncio.Lock,
    ) -> None:
        """Initialize a new instance.

        Preferably use the `FileSystemRequestQueueClient.open` class method to create a new instance.
        """
        self._metadata = metadata

        self._path_to_rq = path_to_rq
        """The full path to the request queue directory."""

        self._lock = lock
        """A lock to ensure that only one operation is performed at a time."""

        self._request_cache = deque[Request]()
        """Cache for requests: forefront requests at the beginning, regular requests at the end."""

        self._request_cache_needs_refresh = True
        """Flag indicating whether the cache needs to be refreshed from filesystem."""

        self._is_empty_cache: bool | None = None
        """Cache for is_empty result: None means unknown, True/False is cached state."""

        self._state = RecoverableState[RequestQueueState](
            default_state=RequestQueueState(),
            persist_state_key=f'request_queue_{self._metadata.id}_state',
            persistence_enabled=True,
            logger=logger,
        )
        """Recoverable state to maintain request ordering, in-progress status, and handled status."""

    @override
    async def get_metadata(self) -> RequestQueueMetadata:
        return self._metadata

    @property
    def path_to_rq(self) -> Path:
        """The full path to the request queue directory."""
        return self._path_to_rq

    @property
    def path_to_metadata(self) -> Path:
        """The full path to the request queue metadata file."""
        return self.path_to_rq / METADATA_FILENAME

    @classmethod
    async def open(
        cls,
        *,
        id: str | None,
        name: str | None,

Review comment (suggestion):
We use these in the SDK for input and other internal thing (storage alias mapping):

<img width="200" height="412" alt="image" src="https://github.com/user-attachments/assets/e861bb4d-e5f1-46dd-b059-513faf954d0b" />

So to stay with those, please use:

```
__RQ_STATE_{self._metadata.id}
```


Code after:
        lock: asyncio.Lock,
    ) -> None:
        """Initialize a new instance.

        Preferably use the `FileSystemRequestQueueClient.open` class method to create a new instance.
        """
        self._metadata = metadata

        self._path_to_rq = path_to_rq
        """The full path to the request queue directory."""

        self._lock = lock
        """A lock to ensure that only one operation is performed at a time."""

        self._request_cache = deque[Request]()
        """Cache for requests: forefront requests at the beginning, regular requests at the end."""

        self._request_cache_needs_refresh = True
        """Flag indicating whether the cache needs to be refreshed from filesystem."""

        self._is_empty_cache: bool | None = None
        """Cache for is_empty result: None means unknown, True/False is cached state."""

        self._state = RecoverableState[RequestQueueState](
            default_state=RequestQueueState(),
            persist_state_key=f'__RQ_STATE_{self._metadata.id}',
            persistence_enabled=True,
            logger=logger,
        )
        """Recoverable state to maintain request ordering, in-progress status, and handled status."""

    @override
    async def get_metadata(self) -> RequestQueueMetadata:
        return self._metadata

    @property
    def path_to_rq(self) -> Path:
        """The full path to the request queue directory."""
        return self._path_to_rq

    @property
    def path_to_metadata(self) -> Path:
        """The full path to the request queue metadata file."""
        return self.path_to_rq / METADATA_FILENAME

    @classmethod
    async def open(
        cls,
        *,
        id: str | None,
        name: str | None,