dls-controls / aioca

Asynchronous Channel Access client for asyncio and Python using libca via ctypes
Apache License 2.0
6 stars 3 forks source link

camonitor all_updates=True not doing what it should? #24

Closed rcardenes closed 2 years ago

rcardenes commented 2 years ago

After noticing I was missing some (very close) updates I decided that this was due to the default merging behavior of camonitor, so I tried monitoring with all_updates=True. But then I got no updates at all. Turns out that all_updates has effects on the size of the underlying deque. Relevant code:

        self.__values: Deque[AugmentedValue] = collections.deque(
            maxlen=0 if all_updates else 1
        )

Now, collections.deque(maxlen=0) gives us a deque that effectively is always full.

Maybe the original intention was to make it collections.deque(maxlen=None) (the default)?

coretl commented 2 years ago

Good catch! That is correct, the original intention was for an unbounded queue. I've fixed it and added a test in #25