-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blocking method to read events #32
Comments
I'm glad you like it. Yes, ProgressesTracker is meant for UIs where you want to render "what's playing". Async support is also something I could look at, but I'm trying to be very conservative with async in Rust until the interfaces are stable; I'm just not ready for the headache of trying to understand the tokio ecosystem yet. But please open up another issue about this and maybe we could start to draft something up. ❤️ |
Events that I'd imagine:
things like that :-)
I've been experimenting with porting I'll open a new issue for |
What about these?
What should happen if two "changes" happen between polling? (Say track is changed, player is paused, and volume has changed) |
Sure. Those events are cheap. I can skip those that I don't want, or filter them, whatever. The more events the better.
they should both fire an event, somehow. I imagine that |
All right, then. So we need an internal buffer of events and on each poll diff last state with current state and add 0..n events on the internal buffer and return the top event on the buffer. When called again, return top event from buffer if there is anything there. Actually checking for DBus events only happens if the buffer is empty, pretty much. Errors I assume would be returned just like other events. There could also be a variant that spawns a thread and adds to a Channel instead, I guess. |
I will try to get to this within the coming week. |
That's kinda messy, isn't it? Would be nicer to have #33 for that :P |
Considering async is such a mess on Rust, I don't think so. I'm likely to make the async support optional until it's nice to work with/around. I don't want all apps to be "infected" with async just because some apps wants support for it, if that makes sense. |
Wouldn't call it a mess, but I agree on making it optional. There's no reason to make it default. Otoh, I think that a library randomly spawning threads is also messy. |
Hey, so I just pushed a PR where I've tried to implement this. Please check out #36 and test it if possible. Everything seems to work nicely on my machine, but granted I have not tried to really stress test it either. |
I've now merged that PR. I'll prepare a release shortly. |
Version 1.1.0 has now been released. |
For the project scrobble.rs, I'm experimenting integrate mpris support.
First the good: it compiles on SailfishOS. Hooray! :D
Now, I find the interface quite cumbersome to work with. The ProgressTracker is mostly meant to track progress within a single track, right? I'm more searching for "events", like the start of a track and the end of a track.
I was wondering if something like that could be implement; for starters, just blocking the thread until an event happens would be cool!
I imagine something like
what do you think?
In a second stage, (optionally) integrating with
dbus-tokio
would be very cool, to havefutures
support. That way, everything can run non-blocking/event driven.The text was updated successfully, but these errors were encountered: