Consider a request builder and response parser design #17
Labels
good first issue
Good for newcomers
issue-type/tech-debt
This includes any maintenance, testing or refactoring that we need to do.
priority/?
unknown priority
size/?
unknown time estimate
team/backend
Work for a backend engineer.
Thinking about #7 more, and my general unhappiness with the verbosity of the
node.Client
interface, it might make more sense to remove all the RPC-specific methods from that interface, and instead offer them as some sort of request builder and response parser pair.So instead of:
One would instead use:
Though not sure where said builders would live (e.g. what the actual name of
pkg
would be).This pattern is used in a couple places to varying effectiveness, namely go-redis and the golang AWS SDK v2. Anyways, just a rough idea for now, but the main advantage is that it separates the definition of new RPCs from
node.Client
, which just needs to implement.Request
and.Subscribe
which makes implementing new virtual clients and or mocks much cleaner.The text was updated successfully, but these errors were encountered: