Skip to content

Commit 823e712

Browse files
author
AudD
committed
audd-python: README — switch longpoll example to one-step form
Main longpoll example uses the new one-step entry point added in the SDK's most recent release. The 2-step derive_longpoll_category → longpoll(category) form stays documented under the 'Tokenless consumers' section, where it's the right tool: a server with the api_token derives the category and ships only the 9-char string to a browser/mobile/embedded client.
1 parent cceaa03 commit 823e712

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ If you can't expose a public callback URL, longpoll instead. AudD still requires
249249
The poll handle exposes three iterators — `matches`, `notifications`, `errors` — populated by a background thread (or task, in async). Use it as a context manager for clean shutdown:
250250

251251
```python
252-
category = audd.streams.derive_longpoll_category(radio_id=42)
252+
radio_id = 1 # any integer you choose — your handle for this stream
253253

254-
with audd.streams.longpoll(category, timeout=30) as poll:
254+
with audd.streams.longpoll(radio_id=radio_id, timeout=30) as poll:
255255
for match in poll.matches:
256256
print(match.song.artist, "", match.song.title)
257257
```

0 commit comments

Comments
 (0)