Skip to content

Commit ec39e6f

Browse files
author
AudD
committed
audd-java: 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 acdb6ff commit ec39e6f

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
@@ -284,8 +284,8 @@ drive a blocking dispatch loop:
284284
```java
285285
import io.audd.streams.LongpollPoll;
286286

287-
String category = audd.streams().deriveLongpollCategory(1234);
288-
try (LongpollPoll poll = audd.streams().longpoll(category)) {
287+
long radioId = 1L; // any integer you choose — your handle for this stream
288+
try (LongpollPoll poll = audd.streams().longpoll(radioId)) {
289289
poll.onMatch(m -> System.out.println(m.song().artist() + "" + m.song().title()));
290290
poll.onNotification(n -> System.out.println("notif: " + n.notificationMessage()));
291291
poll.onError(err -> System.err.println(err));

0 commit comments

Comments
 (0)