dictation-toolbox/natlinkcore

Hide natlink timer?

dougransom opened this issue · 4 comments

so grammars don't call unitentnialllyto replace timer callback

Do you mean the low-level Natlink function (setTimerCallback)?

I think so, Quintijn has been working on a multiplexed timer and i think it will get confused if some other code sets the timer callback.

I think Quintijn's timer can replace the natlink timer.

Okay then. There are a few Natlink functions that can be used to break natlinkcore functionality. SetTimerCallback is one, SetChangeCallback is another. This has been the case for some time. I don't know if it's really worth changing the lower-level API over this. It's up to you, but I would opt for warnings in the documentation instead.

Dragonfly currently uses the setTimerCallback function for its multiplexing timer. Once natlinktimer.py is released, it should be a simple matter to adjust the library to use it instead. I'll leave the old method in as a fallback for older versions of Natlink.

The natlinktimer.py module directly calls setTimerCallback. When another module calls this same function, the natlinktimer multiplexing will be stopped. I will make a test, to make sure it does.