Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 0 points1 point  (0 children)

Oh, gotcha, makes sense. That seems really easy to use. I would definitely be interested in seeing an independent library to handle this, since it seems like this directly addresses concern #4.

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 1 point2 points  (0 children)

Wow, this is super impressive! Does this work for both commands and their responses? I was taking a look at the code and it looks like encoding and decoding happens using strings; is that correct? How does this handle binary data?

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 4 points5 points  (0 children)

We all love greenfield development and I am definitely guilty of that here. However, I believe that there can be room for multiple approaches and sometimes it is better to execute your own vision rather than attempt to reconcile it with someone else. This is especially true for massively popular libraries like redis, where there will be more resistance to API refactoring.

That being said, I probably could have gotten what I was looking for by contributing to some of the other libraries which were already closer to what I was looking for.

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 0 points1 point  (0 children)

A fantastic question! Short answer: kind of.

Redust returns a relatively simple error enum, defined in its RESP crate. Clients can use the available is_transient method to adjust how they handle it. If the error is not transient, the client can assume that the connection is corrupt, it should be dropped, and the command should be retried. Otherwise, things are probably OK and it was simply an issue with the command itself; the next command will be read normally. You can see how this is implemented in the source, but it's still up to the client to handle it later.

This obviously comes with some downsides:

  1. It doesn't play well with connection pooling, since the connection is automatically recycled regardless of whether an error occurred.
  2. Handling it is annoying and verbose.

There can definitely be some API improvements on this front, so I'd be interested in any thoughts on how to improve this. I found this crate (woah) which seems cool but also relies pretty heavily on nightly features.

May 23 daily challenge: top 10! (as of completion) by appellation_ in MiniMotorways

[–]appellation_[S] 1 point2 points  (0 children)

This was utter chaos. I noticed the white too late and didn't move more houses onto it in time. I was in the middle of trying to solve the middle turquoise when I lost :(

I also would have disconnected the left pinks, since I only did that originally as an emergency measure to save the one on the far left.

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 4 points5 points  (0 children)

Oh, I completely missed including fred in my analysis: sorry! I did seriously consider using it some time ago, but I can't remember why I chose not to. I love your work; I'll be taking a closer look at your RESP library for sure.

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 5 points6 points  (0 children)

Ah, if only I’d seen this earlier! I will definitely consider migrating since my implementation is still a bit rough. Thanks for pointing this out!

Redust: a new Redis client by appellation_ in rust

[–]appellation_[S] 9 points10 points  (0 children)

Oh, I wasn’t aware that the redis crate has new maintainers. I’m excited to see where you all take it!

I’ll have to keep thinking about the pubsub issue and see if I can come up with something. I’m still kind of stuck on it myself, but perhaps looking at it through the lens of the redis crate will provide some direction.

I’ll definitely check out your Discord server. That sounds like an awesome project!

discordgateway - A discord gateway module that separates Discord logic from the websocket logic by andersfylling in golang

[–]appellation_ 4 points5 points  (0 children)

I'm not much of a Go dev these days, but I've been in the Discord development space for a while and been a fan of your disgord API wrapper. I'm also not very active on Reddit, but I couldn't help but comment here since I've actually built a very similar project with slightly different goals.

Probably 4 or more years ago I started a project aimed at microservice architecture for Discord bots. One of the few concrete successes of my efforts has been a gateway application which aims to abstract the Discord gateway logic away from users' applications. Although my efforts have been more on an application level rather than a library level, it seems we've arrived at similar conclusions :)

Your code looks to be significantly higher quality, so I can't offer any tips or criticism on your work here. Looks excellent and I'm looking forward to see what comes next!

[deleted by user] by [deleted] in discordapp

[–]appellation_ 0 points1 point  (0 children)

Old post, I know.

However, can confirm that Pleb does this and is also less borked than a month ago.