Skip to content

[FOUND-113] (3/5) Add client protocol selector#37

Open
mattwd7 wants to merge 6 commits intoFOUND-113-pr2-socket-bufferfrom
FOUND-113-pr3-client-protocol-selector
Open

[FOUND-113] (3/5) Add client protocol selector#37
mattwd7 wants to merge 6 commits intoFOUND-113-pr2-socket-bufferfrom
FOUND-113-pr3-client-protocol-selector

Conversation

@mattwd7
Copy link

@mattwd7 mattwd7 commented Feb 27, 2026

Summary

  • Add protocol selection in Dalli::Client so server instances are created from a protocol class hook.
  • Keep binary protocol as default and lazily load meta protocol only when configured.
  • Align cache_nils sentinel usage with shared protocol base.

Test plan

  • Meta/unit and integration tests pass in stacked head branch
  • Default client path remains binary when :protocol is unset

Document protocol selection, route ring server construction through a protocol class hook, and use the shared protocol sentinel for cache-nil miss handling.
Remove the extra timeout rescue/close path from get_multi_yielder now that timeout cleanup is handled at the socket/protocol layers.
@mattwd7 mattwd7 force-pushed the FOUND-113-pr2-socket-buffer branch from 0ee7537 to 5e9593e Compare February 27, 2026 20:52
@mattwd7 mattwd7 force-pushed the FOUND-113-pr3-client-protocol-selector branch from 3b7b5a4 to e271c2e Compare February 27, 2026 20:52
@mattwd7 mattwd7 changed the title FOUND-113 Part 3: Add client protocol selector [FOUND-113][3/5] Add client protocol selector Feb 27, 2026
@mattwd7 mattwd7 changed the title [FOUND-113][3/5] Add client protocol selector [FOUND-113] (3/5) Add client protocol selector Feb 27, 2026
Copy link
Author

@mattwd7 mattwd7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-reviewed ✅

@mattwd7 mattwd7 marked this pull request as ready for review March 3, 2026 00:12
@mattwd7 mattwd7 requested a review from a team as a code owner March 3, 2026 00:12

def protocol_class
if @options[:protocol] == :meta
require 'dalli/protocol/meta'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the meta add so much that the require here is necessary instead of just requiring them? This feels very dependent on side-effects, unless it's a needed opitimization and we can't make it more encapsulated we should consider just having it being required

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, this was a change made to bring performance of :binary protocol in line with our current implementation


def protocol_class
if @options[:protocol] == :meta
require 'dalli/protocol/meta'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the meta add so much that the require here is necessary instead of just requiring them? This feels very dependent on side-effects, unless it's a needed opitimization and we can't make it more encapsulated we should consider just having it being required

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