Skip to content

Raw cmd for special usages#17

Open
bisho wants to merge 1 commit into
03-16-multi-getfrom
03-16-raw_cmd_for_special_usages
Open

Raw cmd for special usages#17
bisho wants to merge 1 commit into
03-16-multi-getfrom
03-16-raw_cmd_for_special_usages

Conversation

@bisho
Copy link
Copy Markdown
Member

@bisho bisho commented Mar 17, 2026

Motivation / Description

This change adds a raw command passthrough capability to the memcache socket implementation, allowing users to send arbitrary memcache protocol commands and receive the raw response bytes. This is useful for accessing memcache features that may not have dedicated high-level methods or for debugging purposes.

Its implementation is not performance oriented, since this should not be used.

Possible usages: flush for test suites, stats commands...

Changes introduced

  • Added raw_cmd method to MemcacheSocket class that accepts raw command bytes and an optional multi_line parameter
  • The method automatically appends \r\n to commands if not already present
  • For single-line responses, reads until \r\n and returns the content before it
  • For multi-line responses, reads until END\r\n and returns all content before the terminator
  • Uses a separate buffer to avoid interfering with the main I/O state
  • Releases the GIL during socket operations for better performance
  • Added comprehensive test coverage including single-line commands, multi-line responses, empty responses, and verification that the method doesn't affect subsequent meta commands

Copy link
Copy Markdown
Member Author

bisho commented Mar 17, 2026

This was referenced Mar 17, 2026
@bisho bisho marked this pull request as ready for review March 17, 2026 08:57
@ethervoid
Copy link
Copy Markdown

@claude review this pr

@bisho bisho force-pushed the 03-16-multi-get branch from 044cd79 to 2081924 Compare March 24, 2026 09:16
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from ccc5efa to 700ddfe Compare March 24, 2026 09:16
@bisho bisho force-pushed the 03-16-multi-get branch from 2081924 to c944e91 Compare March 24, 2026 17:11
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from 700ddfe to 85a47cc Compare March 24, 2026 17:11
@bisho bisho force-pushed the 03-16-multi-get branch from c944e91 to f66d7e5 Compare March 24, 2026 18:07
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from 85a47cc to 40b3616 Compare March 24, 2026 18:07
@bisho bisho requested a review from a team March 25, 2026 08:29
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from 40b3616 to bb9fb20 Compare March 25, 2026 09:28
@bisho bisho force-pushed the 03-16-multi-get branch from f66d7e5 to 9cb2fb7 Compare March 25, 2026 09:28
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from bb9fb20 to cb290c6 Compare March 25, 2026 14:12
@bisho bisho force-pushed the 03-16-multi-get branch from 9cb2fb7 to 2ba74cc Compare March 25, 2026 14:12
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from cb290c6 to f1f281e Compare March 25, 2026 14:18
@bisho bisho force-pushed the 03-16-multi-get branch 2 times, most recently from b4355f6 to f582779 Compare March 25, 2026 14:21
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from f1f281e to 3d19e20 Compare March 25, 2026 14:21
@bisho bisho force-pushed the 03-16-multi-get branch 2 times, most recently from 738c0b9 to ffe2649 Compare March 25, 2026 14:28
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch 2 times, most recently from a30bec7 to 05b2753 Compare March 26, 2026 12:47
@bisho bisho force-pushed the 03-16-multi-get branch from ffe2649 to 5ef1f07 Compare March 26, 2026 12:47
@bisho bisho force-pushed the 03-16-multi-get branch from 5ef1f07 to acf1c63 Compare March 26, 2026 13:03
@bisho bisho force-pushed the 03-16-raw_cmd_for_special_usages branch from 05b2753 to f005aee Compare March 26, 2026 13:03
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