goHamlib icon indicating copy to clipboard operation
goHamlib copied to clipboard

Make Rig an interface?

Open tzneal opened this issue 6 years ago • 2 comments

Hey Tobias,

The issue I'm running into is that querying the rig for its frequency is expensive. There's no good way to throw in a caching layer, but if Rig was an interface I could easily add a CachedRig that wrapped a rig and cached all of the Rig get calls for a few seconds to save calls to the radio.

Thoughts?

tzneal avatar Jun 15 '18 22:06 tzneal

Hi Todd,

I guess sooner or later everybody runs into this kind of bottleneck issues with hamlib ;-) One solution might be to change from polling to the hamlib callbacks which inform about changes. Although I've heard that the callbacks are not implemented in all backends.

In gorigctl, which is intended as a rigctld replacement, but using Protobuf instead of plain TCP sockets, I added a caching layer between the RPC calls and the radio connected via goHamlib. I defined there a radio interface and then implemented it for a local and a remote radio.

But I understand that you want to rather work directly with goHamlib, without an RPC layer in between.

Converting rig into an interface might be a viable option. My main concern is that the interface will have to be changed with each new method call added. Especially since rig in goHamlib currently doesnt implement the full C api for hamlib.

hw?

Tobias

dh1tw avatar Jun 17 '18 14:06 dh1tw

sorry, accidentally closed the issue :-)

dh1tw avatar Jun 17 '18 14:06 dh1tw