Skip to content

refactor/fix: stream subscriptions in RedisConnector#795

Open
d-perl wants to merge 2 commits intomainfrom
fix/simplify_stream_subscription
Open

refactor/fix: stream subscriptions in RedisConnector#795
d-perl wants to merge 2 commits intomainfrom
fix/simplify_stream_subscription

Conversation

@d-perl
Copy link
Contributor

@d-perl d-perl commented Mar 13, 2026

Refactors the Redis stream subscription logic in the RedisConnector

  • unifies all "normal" stream subscriptions: those which should read from the start of the stream are migrated to the normal subscriptions after the first read attempt, by reading up to the place those streams have been read already in the normal subscriptions, if it exists
  • clarifies the organisation by moving the subscription logic methods to a separate class
  • fixes some logical mistakes:
    • it is an error to register the same stream with the same callback more than once
    • no longer blocks separately on from_start streams after the first try
    • some small errors in the tests

Looks like some small patch in BEC widgets will be required where duplicate subs were previously ignored - workflow against BW branch https://github.com/bec-project/bec/actions/runs/23142709927

closes #790

@d-perl d-perl force-pushed the fix/simplify_stream_subscription branch 2 times, most recently from 2cd3083 to 758f4d2 Compare March 16, 2026 08:21
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 83.24607% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_lib/bec_lib/redis_connector.py 83.24% 19 Missing and 13 partials ⚠️

📢 Thoughts on this report? Let us know!

@d-perl d-perl changed the title WIP refactor: stream subs in redisconnector refactor/fix: stream subscriptions in RedisConnector Mar 16, 2026
@d-perl d-perl requested a review from a team March 16, 2026 08:39
@d-perl d-perl force-pushed the fix/simplify_stream_subscription branch from 3dacf1e to fcc6b6c Compare March 16, 2026 11:57
d-perl added 2 commits March 16, 2026 15:16
- clearer organisation: class to handle subscription tasks
- more correct: no multiple subscriptions, test logic
@d-perl d-perl force-pushed the fix/simplify_stream_subscription branch from fcc6b6c to 338943e Compare March 16, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate from_start and non-from_start xread commands

1 participant