ezmsg-org / ezmsg

Pure-Python DAG-based high-performance SHM-backed pub-sub and multi-processing pattern
https://ezmsg.readthedocs.io/en/latest/
MIT License
15 stars 6 forks source link

Feature: `ezmsg.util.rate.Rate` with synchronous sleep #151

Closed griffinmilsap closed 3 weeks ago

griffinmilsap commented 3 weeks ago

I added a synchronous sleep mechanism to rate for testing some sync/async performance testing. I tried to replicate as few code-paths as possible.

I would have loved to make the async sleep method Rate.asleep and the sync sleep method Rate.sleep but that would be a breaking change. I thought about making the synchronous sleep Rate.ssleep but that seems typo-prone. I ultimately landed on Rate.sleep_sync and most ezmsg code is async anyway, so I don't think this is something to lose sleep over ;)