Skip to content

refactor: drop vestigial client param from _consume - #100

Merged
lesnik512 merged 1 commit into
mainfrom
refactor/drop-consume-client-param
Oct 4, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
refactor/drop-consume-client-param

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #65.

TimersSubscriber.start() passed self._client into _consume as a positional argument, and _consume used it once, for the startup ping() that sets start_signal. The loop's Redis I/O already goes through TimerStore, which reads ConnectionState.client on every call. _consume now takes only start_signal and pings through the existing _client property. This finishes what #43 did for _get_msgs and _claim_and_consume.

#65 raised a reconnect concern: binding the client at start could keep a stale client. That doesn't apply. The bound client was only ever used for the one ping before the loop starts, and nothing rebinds ConnectionState._client while the broker runs (connect() returns the caller-owned client, disconnect() does nothing, and only the test broker's _patch_broker swaps it, before any loop runs). So behavior is unchanged and no comment about binding is needed.

add_task is called with func_kwargs= by keyword since func_args defaults to None.

Verification:

  • just lint-ci passes.
  • Full suite: 168 passed against Redis 8, no skips, no test changes.

@lesnik512
lesnik512 merged commit 62d0ec0 into main Oct 4, 2026
13 checks passed
@lesnik512
lesnik512 deleted the refactor/drop-consume-client-param branch October 4, 2026 08:07
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.

Remove the vestigial client parameter from TimersSubscriber._consume

1 participant