Decouple PubSub from Redis in the Broker interface#1122
Open
halomanlodestar wants to merge 4 commits into
Open
Decouple PubSub from Redis in the Broker interface#1122halomanlodestar wants to merge 4 commits into
halomanlodestar wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1122 +/- ##
==========================================
+ Coverage 63.34% 63.44% +0.10%
==========================================
Files 29 30 +1
Lines 4984 4998 +14
==========================================
+ Hits 3157 3171 +14
- Misses 1549 1550 +1
+ Partials 278 277 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
This is out of scope. See #1138. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sub part of #173
Summary
This change addresses the TODO on
CancelationPubSub()in Broker interface atinternal/base/base.go:726.Removes the hard dependency on
*redis.PubSubfrom the Broker interface, replacing it with a minimalPubSubinterface. This is a prerequisite for supporting non-Redis broker implementations.Motivation
CancelationPubSub()in theBrokerinterface previously returned*redis.PubSubdirectly, making it impossible to implement a compliant broker without Redis. This change abstracts that dependency behind an interface.Changes
New
base.PubSubinterfacePubSubinterface withChannel() <-chan string, andCloseBroker.CancelationPubSub()now returns (PubSub, error) instead of (*redis.PubSub, error)New RedisPubSub adapter
*redis.PubSubto implementbase.PubSubTesting
Existing
TestCancelationPubSubupdated to match the new <-chan string API (reads msg directly instead of msg.Payload).