Skip to content

JSON/RPC generic type request/response type to avoid double parsing#101

Merged
EnriqueL8 merged 2 commits into
mainfrom
rpc-generics
Jun 23, 2026
Merged

JSON/RPC generic type request/response type to avoid double parsing#101
EnriqueL8 merged 2 commits into
mainfrom
rpc-generics

Conversation

@peterbroadhurst

Copy link
Copy Markdown
Contributor

For high performance JSON/RPC heavy applications the two-step parsing in rpcbackend where it uses a fftypes.JSONAny then parses from that into the supplied interface{} is inefficient.

This can be solved with generic based functions that are typed to the result.

  • CallRPCTyped - for a single call
  • CallRPCBatchTyped - for a batch of types with the same result type

Care is taken this PR to avoid any interface change on the existing functions, while also striving to avoid code duplication.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@EnriqueL8 EnriqueL8 merged commit bc74391 into main Jun 23, 2026
3 checks passed
@EnriqueL8 EnriqueL8 deleted the rpc-generics branch June 23, 2026 09: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.

3 participants