blacksky-algorithms / rsky

ATProto Feed Generator built in Rust
https://blackskyweb.xyz
Apache License 2.0
47 stars 4 forks source link

Implement Websockets for `com.atproto.sync.subscriberepos` #7

Open DrewMcArthur opened 5 days ago

DrewMcArthur commented 5 days ago

background

see the spec on event streams and subscribe endpoints here. see the rocket_ws crate here see the subscription type in the atproto lexicon here

generally, when a client connects to a subscribe endpoint (see here), they connect via websockets to listen to events. they're one way (server -> client), with a few optional parameters including a backfill window or a cursor, allowing the subscriber to catch up on missed messages.

requirements

DrewMcArthur commented 3 days ago

fyi i've begun work on this in https://github.com/DrewMcArthur/rsky/issues/3

seems like everything runs, i just have to figure out how to test it.

rudyfraser commented 3 days ago

Sick! I had also started on this but I'll work on other stuff for now. As an FYI, I generally have been trying to keep the code as close to the TS implementation as possible https://github.com/bluesky-social/atproto/blob/e956ac06be32cbfef06605cda6298b5fd621513a/packages/pds/src/api/com/atproto/sync/subscribeRepos.ts

For testing, you should be able to use a client like Postman to subscribe to your websocket endpoint and in another client do things like create a new account, update the handle, create a new post, etc. and have the messages come through. All of those endpoints exist today under the com.atproto namespaces.