feat: redis-based cas broker#16
Merged
Merged
Conversation
Signed-off-by: Cloorc <wittcnezh@foxmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Redis-based Compare-And-Swap (CAS) broker implementation for the matcher system. The Redis CAS broker provides an alternative event distribution mechanism that uses Redis SET operations with polling instead of Redis Streams, offering simpler conflict resolution and reduced dependency complexity.
Key changes:
- Implementation of Redis CAS broker with polling-based event consumption
- Renaming of broker interfaces from
EventBrokerInterfacetoBrokerfor consistency - Comprehensive test coverage for the new Redis CAS broker including integration tests
Reviewed Changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| types.go | Renamed EventBrokerInterface to Broker |
| redis_cas_broker.go | New Redis CAS broker implementation with timestamp-based event ordering |
| redis_cas_broker_test.go | Unit tests for Redis CAS broker functionality |
| redis_cas_broker_integration_test.go | Integration tests for multi-node scenarios |
| scripts/test_redis_setup.sh | Test setup script for Redis environment |
| redis_broker.go | Renamed RedisEventBroker to RedisBroker |
| kafka_broker.go | Renamed KafkaEventBroker to KafkaBroker |
| matcher.go | Updated to use renamed Broker interface |
| api.go | Updated broker interface references |
| brokers_test.go | Updated tests for renamed interface |
| example/ files | Updated examples to use new broker interface |
| docs/BROKERS.md | Updated documentation for interface rename |
| go.mod | Added testify dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: cloorc <13597105+cloorc@users.noreply.github.com>
Signed-off-by: Cloorc <wittcnezh@foxmail.com>
massiveio
approved these changes
Aug 27, 2025
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.
No description provided.