Skip to content

Subscribe to engine events on the engine's Redis client - #179

Merged
dbaseqp merged 2 commits into
dbaseqp:mainfrom
tire-fire:refactor/consolidate-redis-clients
Nov 7, 2026
Merged

dbaseqp merged 2 commits into
dbaseqp:mainfrom
tire-fire:refactor/consolidate-redis-clients

Conversation

@tire-fire

Copy link
Copy Markdown
Contributor

Summary

Start(), waitForReset() and rvb() each built their own Redis client from REDIS_ADDR (falling back to quotient_redis:6379) just to subscribe to the events channel, and rvb() did so every round. They now subscribe through se.RedisClient, the client the engine already uses to publish those events and to move tasks and results. waitForReset becomes a method so it can reach it.

This also fixes the engine tests. They publish to the test Redis (REDIS_HOST/REDIS_PORT, port 6380 in CI), but rvb() subscribed wherever REDIS_ADDR pointed, and two tests set that to localhost:6379. So in tests the engine never saw events published during a round. Those two t.Setenv("REDIS_ADDR", ...) calls are removed, since nothing reads it on that path anymore.

The runner still reads REDIS_ADDR for its own connection; that's unchanged.

Tests

  • New TestRvb_StopsOnResetPublishedToEngineRedis publishes reset on the engine's Redis client during result collection and expects rvb() to stop with "reset event received". It fails against the current engine.go (rvb() returns nil after the round times out) and passes with this change.
  • The full suite, go vet and golangci-lint pass.

@tire-fire
tire-fire force-pushed the refactor/consolidate-redis-clients branch from 7922a4b to 0e63829 Compare November 7, 2026 05:06
@tire-fire
tire-fire force-pushed the refactor/consolidate-redis-clients branch from 0e63829 to 954072e Compare November 7, 2026 05:14
@dbaseqp
dbaseqp merged commit 49f1bbf into dbaseqp:main Nov 7, 2026
5 checks passed
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.

2 participants