permit redis pub/sub to work when host != localhost #1277
Merged
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.
it's complicated
Previously, the redis plugin worked well, except when the pub/sub channel was on a host other than 127.0.0.1. PR #1275 sorta fixed the karma plugin so that it could subscribe to a remote redis when the redis plugin (and by extension, result_store) could pub/sub to that remote redis host. It was not an optimal way to fix it though, because it duplicated the redis.ini parsing and connection logic.
With these changes, the redis connection and subscription functions are consolidated into the redis plugin, where they can be called by plugins that subscribe to result_store messages (currently karma & watch). Now the redis plugin has a config section for pubsub and all publishers and subscribers can use the same settings, without each subscriber having to duplicate the pubsub connection logic. That logic was complicated by the fact that subscribers must have a different redis client than the publisher.
the changes
connection message