feat: add method name formatter option for client handlers #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #136
This PR allows a user to specify a method name formatter for a client handler on the client side.
Although we can create a client handler to accept reversed calls from the server, it wasn't possible to configure a method name format for it (like
WithMethodNameFormatter
). This restricts the use of reverse calls to the default method name formatter, so it wasn't possible to accept a reverse call with a different method name format (like theeth_subscription
method name).Note: while creating a test for this new method, I studied other tests and found an undocumented feature: method name alias. This can also solve the above issue, but it requires creating an alias for every method name. The new solution proposed by this PR is applied to the entire client handler. I've updated the docs to improve DX.
Note: in the server, the formatter specified by the
WithServerMethodNameFormatter
config is also applied to the reverse calls. Do you want me to change this?Regards