Elektordi / obs-websocket-py

Python library to communicate with an obs-websocket server (for OBS Studio)
MIT License
235 stars 59 forks source link

Use a Condition object instead of polling #52

Closed marcan closed 1 year ago

marcan commented 3 years ago

This avoids polling for websocket replies every 100ms, which both saves CPU usage and reduces the latency of requests.

Elektordi commented 3 years ago

Hello,

I was already working on something similar here: #37 There is a working proof on concept on branch test-37.

marcan commented 3 years ago

Looks reasonable. The Condition approach is closer to the original code flow (i.e. checking for an answer), but it does require a lock, while events do not. I think both approaches work.

Feel free to close this if the other commit gets merged :)

Elektordi commented 1 year ago

Sorry for the delay, I just merged #37