Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
75
fork

Configure Feed

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

add code snippet to README

videah 8c8a14fc 6fc8a6bc

+27
+27
README.md
··· 7 7 Bluesky [Jetstream](https://github.com/bluesky-social/jetstream) 8 8 service. 9 9 10 + ```rust 11 + let config = JetstreamConfig { 12 + endpoint: DefaultJetstreamEndpoints::USEastOne.into(), 13 + compression: JetstreamCompression::Zstd, 14 + ..Default::default () 15 + }; 16 + 17 + let jetstream = JetstreamConnector::new(config).unwrap(); 18 + let (receiver, _) = jetstream.connect().await.unwrap(); 19 + 20 + while let Ok(event) = receiver.recv_async().await { 21 + if let Commit(commit) = event { 22 + match commit { 23 + CommitEvent::Create { info, commit } => { 24 + println ! ("Received create event: {:#?}", info); 25 + } 26 + CommitEvent::Update { info, commit } => { 27 + println ! ("Received update event: {:#?}", info); 28 + } 29 + CommitEvent::Delete { info, commit } => { 30 + println ! ("Received delete event: {:#?}", info); 31 + } 32 + } 33 + } 34 + } 35 + ``` 36 + 10 37 ## Example 11 38 12 39 A small example CLI utility to show how to use this crate can be found in the `examples` directory. To run it, use the