sugyan / atrium

Rust libraries for Bluesky's AT Protocol services.
MIT License
218 stars 26 forks source link

atrium-streams + atrium-streams-client implementation #223

Closed oestradiol closed 2 months ago

oestradiol commented 2 months ago

This Pull Request adds two new crates:

TODO:

sugyan commented 2 months ago

Thank you for the pull request!

It is great that the crate is divided into two, one for definitions such as traits, and one for providing concrete implementations.

However, I would like you to reconsider the crate name. My thoughts are as follows:

I'd love to hear your thoughts too.

oestradiol commented 2 months ago
* Is "subscription" included in XRPC? [...] The endpoint is indeed `"/xrpc/{nsid}"` [...]

Hmm yes, I think so? Because of the endpoint, as you said.

  I do not understand the exact definition of XRPC, but https://atproto.com/specs/event-stream is listed in a separate section as "HTTP API (XRPC)"

Honestly, me neither, it is a little confusing hahah

  but I felt that there is no need to include "xrpc" in the crate name.

Hmm okay, I agree with that. The name is a little too verbose.

* Should we use "wss"?
  My understanding from reading https://atproto.com/specs/event-stream is that "WebSocket is used as the initial transport for event streams" and that it may become something else in the future.
  I thought that the name `WssClient` would be fine for the implementation provided as the default client, but for the name of the trait provided by the library, it would be better to use a more abstract name, such as "stream".

I agree that the name WssClient would be better used for the default client, instead of DefaultClient itself. So yeah, we can change this one. Now, for the trait provided, I am not really sure what name we should use. I feel like Stream is a little misleading because of the Stream trait. Maybe we could just name it StreamClient instead? I like that better.


All that being said, for the trait names, I propose something like atrium-streams and atrium-streams-client. What do you think?

sugyan commented 2 months ago

Thank you for considering this! Yes, I feel that StreamClient or EventStreamClient would be a good name for the trait name, and atrium-streams and atrium-streams-client seem very suitable for the crate names!

oestradiol commented 2 months ago

!?

Well, good to know! Apparently GitHub closes Pull Requests if you rename a branch!

That is a very unexpected behaviour that I did not know of, wow...

I apologise. I'll open another pull request, since it won't let me re-open this one...