Skip to content

Commit 76bb510

Browse files
author
AudD
committed
audd-rust: 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 88daaca commit 76bb510

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
@@ -290,8 +290,8 @@ If hosting a callback receiver isn't an option, longpoll for events from the cli
290290
use futures_util::StreamExt;
291291
292292
# async fn run(audd: AudD) -> Result<(), audd::AudDError> {
293-
let category = audd.streams().derive_longpoll_category(1); // computed locally
294-
let mut poll = audd.streams().longpoll(&category, LongpollOptions::default()).await?;
293+
let radio_id = 1i64; // any integer you choose — your handle for this stream
294+
let mut poll = audd.streams().longpoll_by_radio_id(radio_id, LongpollOptions::default()).await?;
295295
296296
loop {
297297
tokio::select! {

0 commit comments

Comments
 (0)