Skip to content

Refactor Direct Reply-to one more time#16253

Merged
michaelklishin merged 3 commits intomainfrom
mk-item-43
May 4, 2026
Merged

Refactor Direct Reply-to one more time#16253
michaelklishin merged 3 commits intomainfrom
mk-item-43

Conversation

@michaelklishin
Copy link
Copy Markdown
Collaborator

There are no functional (user-observable) changes.

"TTB" in the tests is for "term to binary".

Copy link
Copy Markdown
Contributor

@kjnilsson kjnilsson left a comment

Choose a reason for hiding this comment

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

just wondering if we need a new function for this.

Comment thread deps/rabbit/src/rabbit_pid_codec.erl Outdated
Comment thread deps/rabbit/src/rabbit_pid_codec.erl Outdated
There are no functional (user-observable) changes.
Conflicts:
	deps/rabbit/Makefile
Plus address cosmetic review feedback.
@michaelklishin michaelklishin merged commit b8591ac into main May 4, 2026
189 checks passed
@michaelklishin michaelklishin deleted the mk-item-43 branch May 4, 2026 18:26
michaelklishin added a commit that referenced this pull request May 4, 2026
Refactor Direct Reply-to one more time (backport #16253)
michaelklishin added a commit that referenced this pull request May 4, 2026
michaelklishin added a commit that referenced this pull request May 4, 2026
Refactor Direct Reply-to one more time (backport #16253) (backport #16297)
%% such as <<"reply@1234567">>. Malformed input raises and is caught by
%% the surrounding try.
node_hash_from_binary(NodeBin) ->
[_Prefix, Suffix] = binary:split(NodeBin, <<"@">>),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could use a compiled pattern here as done in

Cp = case persistent_term:get(?CP_DOT, undefined) of
undefined ->
P = binary:compile_pattern(<<".">>),
persistent_term:put(?CP_DOT, P),
P;
P ->
P
end,
try
[PidBase64, _KeyBase64] = binary:split(Bin, Cp),
for performance reasons since this is called per message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants