Skip to content

Add callback for picking next server to connect to#1476

Draft
Jarema wants to merge 3 commits into
mainfrom
add-reconnect
Draft

Add callback for picking next server to connect to#1476
Jarema wants to merge 3 commits into
mainfrom
add-reconnect

Conversation

@Jarema

@Jarema Jarema commented Oct 16, 2025

Copy link
Copy Markdown
Member

Overview

User needs a way to customize how connections and reconnections are done.
Currently, there are only two modes:

a) client randomizes provided set of servers (and discovered servers)
b) client retains the order

What we want

Ability for the client to alter servers that are picked for reconnection.

Proposed solution

User has access to two callbacks:

Server info callback

When server sends to the client new INFO, which can happen when server discoveres new servers in the cluster

Reconnect callback

When client is about to reconnect
It's different from the current reconnect callback, which is purely informative

TODO

  • Improve the tests
  • make sure no default behavior is broken

Signed-off-by: Tomasz Pietrek <tomasz@synadia.com>
Signed-off-by: Tomasz Pietrek <tomasz@synadia.com>
Signed-off-by: Tomasz Pietrek <tomasz@synadia.com>
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.

1 participant