You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks! This is a great library. I am writing a asyncio based library and I am integrating pulsectl on it.
For now I just started a thread and let pulsectl run on it, however it would be interesting to have proper asyncio integration with pulsectl with it. I saw the other issue with gobject (#11) and I am interested if you know some tips on how to integrate pulsectl with async.
The text was updated successfully, but these errors were encountered:
There's also https://github.com/mk-fg/python-pulse-control#event-handling-code-threads section in the README about such eventloop integration.
Specifically, I think you'd want to use set_poll_func wrapper, which libpulse exposes for that.
Don't think it should break high-level wrappers if you're willing to treat libpulse calls as instant/blocking ones, but as also mentioned there, didn't really look into such integration myself beyond what mentioned in #11 already.
Ideally for asyncio there'd have to be an entirely separate module - e.g. aiopulsectl - which would have all its calls async (which they are, especially if you're accessing pulse over crappy network), but that'd be an entirely different code with different api.
It should be relatively straightforward to implement on top of same ctypes wrappers (with asyncio poller callback set), especially if you only need like 5 calls from there, so I'd probably do that instead of trying to shoehorn this module into asyncio project in a blocking fashion.
If you'll end up going the second way (a proper asyncio libpulse wrapper), I'd suggest posting it to github/pypi, even if it'll end up having just a few calls that you need wrapped - that's how this one started too, and turned out to be useful to people somehow anyway :)
First, thanks! This is a great library. I am writing a
asyncio
based library and I am integratingpulsectl
on it.For now I just started a thread and let
pulsectl
run on it, however it would be interesting to have proper asyncio integration withpulsectl
with it. I saw the other issue withgobject
(#11) and I am interested if you know some tips on how to integratepulsectl
withasync
.The text was updated successfully, but these errors were encountered: