don't
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs(jetstream): add readme

Signed-off-by: tjh <x@tjh.dev>

tjh 1aad87bb 726430ee

+38
+38
crates/gordian-jetstream/README.md
··· 1 + # gordian-jetstream 2 + 3 + An opinionated Jetstream client. 4 + 5 + Opinions include: 6 + 7 + - Events should be deserialized with minimal copying. 8 + - Compression should be always on if enabled a compile time. 9 + 10 + ## Usage 11 + 12 + Create a configuration and spawn a client. 13 + 14 + ```rust 15 + use gordian_jetstream::Event; 16 + use gordian_jetstream::JetstreamConfig; 17 + 18 + let config = JetstreamConfig::default().with_collections(["app.bsky.feed.like"]); 19 + let (client, events, task) = config.connect(); 20 + 21 + // Spawn the client task. 22 + tokio::spawn(task); 23 + 24 + // Receive events from the Jetstream 25 + while let Some(message) = events.recv_async().await { 26 + match message.deserialize()? { 27 + Event::Commit(commit) => { 28 + // ... commit crimes with commit events 29 + } 30 + Event::Account(account) => { 31 + // ... do stuff with account events. 32 + } 33 + Event::Identity(identity) => { 34 + // ... do stuff with identity events. 35 + } 36 + } 37 + } 38 + ```