Skip to content

Commit

Permalink
use jetstream2 in examples
Browse files Browse the repository at this point in the history
seems to be more stable
  • Loading branch information
mackuba committed Nov 15, 2024
1 parent 67f915c commit 892b3c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Alternatively, you can connect to a [Jetstream](https://github.com/bluesky-socia
Jetstream connections are made using a `Skyfall::Jetstream` instance, which has more or less the same API as `Skyfall::Firehose`, so it should be possible to switch between those by just changing the line that creates the client instance:

```rb
sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network')
sky = Skyfall::Jetstream.new('jetstream2.us-east.bsky.network')

sky.on_message { |msg| ... }
sky.on_error { |e| ... }
Expand Down Expand Up @@ -113,7 +113,7 @@ Jetstream has a similar mechanism, except the cursor is the event's timestamp in
```rb
cursor = load_cursor

sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', { cursor: cursor })
sky = Skyfall::Jetstream.new('jetstream2.us-east.bsky.network', { cursor: cursor })
sky.on_message do |msg|
save_cursor(msg.seq)
process_message(msg)
Expand Down Expand Up @@ -283,7 +283,7 @@ Jetstream allows you to specify [filters](https://github.com/bluesky-social/jets
To use these filters, pass the "wantedCollections" and/or "wantedDids" parameters in the options hash when initializing `Skyfall::Jetstream`. You can use the original JavaScript param names, or a more Ruby-like snake_case form:

```rb
sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', {
sky = Skyfall::Jetstream.new('jetstream2.us-east.bsky.network', {
wanted_collections: 'app.bsky.feed.post',
wanted_dids: @dids
})
Expand All @@ -292,7 +292,7 @@ sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', {
For collections, you can also use the symbol codes used in `Operation#type`, e.g. `:bsky_post`:

```rb
sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', {
sky = Skyfall::Jetstream.new('jetstream2.us-east.bsky.network', {
wanted_collections: [:bsky_post]
})
```
Expand Down
2 changes: 1 addition & 1 deletion example/jet_monitor_phrases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
end

# tell Jetstream to send us only post records
sky = Skyfall::Jetstream.new('jetstream1.us-east.bsky.network', { wanted_collections: [:bsky_post] })
sky = Skyfall::Jetstream.new('jetstream2.us-east.bsky.network', { wanted_collections: [:bsky_post] })

sky.on_message do |msg|
# we're only interested in repo commit messages
Expand Down

0 comments on commit 892b3c4

Please sign in to comment.