sdrangel icon indicating copy to clipboard operation
sdrangel copied to clipboard

Make all REST API requests sync?

Open sandric opened this issue 1 month ago • 1 comments

I was playing with rest api creating frequency scanner similar to scanner.py but in nodejs. The thing I noticed is that I constantly need to struggle with adding delays after api call to change device or channel settings. It is easily noticeable on start or stop api call on device - its a bit computationally heavy task so its always returns opposite state of a device. I was wondering whats the best way to overcome this since I do not know exactly how long should I wait till say I start querying report on a channel for a device that is still starting, although api call already finished. Right not its just dumb delays, but maybe there's a better more elegant way? Maybe listen to reverse api request for every api call I make as a "finish" signal? This way code becomes quite a bit more complex, would be cool to have simple "sync" flag to return answer only when task completely done..

sandric avatar May 28 '24 13:05 sandric