Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving Redis backends to separate shards #90

Merged
merged 3 commits into from
May 26, 2024
Merged

Moving Redis backends to separate shards #90

merged 3 commits into from
May 26, 2024

Conversation

jwoertink
Copy link
Collaborator

@jwoertink jwoertink commented May 20, 2024

Closes #88
Fixes #74

The redis backends have now been moved to their own separate shards
https://github.com/cable-cr/cable-redis
https://github.com/cable-cr/cable-redis-legacy

The nice thing is we can now test and use the legacy redis shard without conflicts or altering files. To use them, you will just require the backend you want

dependencies:
  cable:
    github: cable-cr/cable
  cable-redis:
    github: cable-cr/cable-redis

This also gives a start in to adding more backend possibilities like NATS, LavinMQ, Postgres, etc.... I think I also want to make a Memory backend that could be used for single server mini uses.

@jwoertink jwoertink added the BREAKING CHANGE This includes a change that breaks backwards compatibility label May 20, 2024
@jwoertink
Copy link
Collaborator Author

I need to figure out the best way to test all this... If I add cable-redis as a dev dependency, then I get

Error: can't find file 'cable'

Maybe I need to make cable a dependency of cable-redis and not just dev dep? 🤔

Or do I only test that things work with the DevBackend in this shard, and anything related to the other backends would all have to be tested individually?

@jwoertink jwoertink marked this pull request as ready for review May 26, 2024 16:00
@jwoertink
Copy link
Collaborator Author

Look at that! All 💚

In order to make this work, I removed the require "cable" statement from cable-redis. Cable is still a dev dep of cable-redis, but it's no longer required explicitly. I think this makes sense because you would never use cable-redis without having cable. I'm hoping this means you shouldn't run in to issues where you update cable but then get version conflicts from, for example, if cable-redis made cable a dependency directly and was locked to v0.3.0 or whatever.

I left cable-redis as a development dependency of this shard so we can have a full-stack testing to ensure a real use-case. I expect each backend adapter to provide its own set of tests though.

@jwoertink jwoertink merged commit b6ec057 into master May 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE This includes a change that breaks backwards compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separating the backends Conflicting redis shards name
1 participant