gorpc icon indicating copy to clipboard operation
gorpc copied to clipboard

Dispatcher.AddService: allow clients to register interfaces

Open bits01 opened this issue 9 years ago • 0 comments

Currently Dispatcher.AddService requires a *struct to be registered. For clients that is not convenient, the options are to register the actual struct used on the server side, but that will pull in more code than necessary into the client or create a dummy struct on the client side with dummy methods that match the server side struct. It would be nice to just have a common interface that can be shared by both the server and the client side. The server would have to register a concrete impl of that interface of course, but that struct would be known to the server only, while the client could register just the interface so that it can make calls.

bits01 avatar Aug 15 '16 03:08 bits01