audio streaming app
plyr.fm
1---
2title: queue
3sidebarTitle: queue
4---
5
6# `backend.api.queue`
7
8
9queue api endpoints.
10
11## Functions
12
13### `get_queue` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/queue.py#L31)
14
15```python
16get_queue(response: Response, db: Annotated[AsyncSession, Depends(get_db)], session: Session = Depends(require_auth)) -> QueueResponse
17```
18
19
20get current queue state with ETag for caching.
21
22
23### `update_queue` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/queue.py#L67)
24
25```python
26update_queue(update: QueueUpdate, session: Session = Depends(require_auth), if_match: Annotated[str | None, Header()] = None) -> QueueResponse
27```
28
29
30update queue state with optimistic locking via If-Match header.
31
32the If-Match header should contain the expected revision number (as ETag).
33if there's a conflict (revision mismatch), returns 409.
34
35
36## Classes
37
38### `QueueResponse` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/queue.py#L16)
39
40
41queue state response model.
42
43
44### `QueueUpdate` [source](https://github.com/zzstoatzz/plyr.fm/blob/main/backend/src/backend/api/queue.py#L24)
45
46
47queue state update model.
48