-
-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] trying to reach feature parity with mpv scripts #3
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
base: master
Are you sure you want to change the base?
Conversation
this allows to run commands like bundle install if theres a syntax error in the codebase
100ms is way too high of a timeframe
mpv recently added new infrastructure to handle generic executable scripts. Instead of unix sockets it uses file descriptor inheritance. See: mpv-player/mpv@e2ab6b7
this stuff seems pointless if not worse. alive makes the methods fail silently.
This makes the code way easier to follow.
This allows the main thread to block until mpv has quit, allowing the event loop to continue pumping.
4fbfdc1
to
2a7cbbe
Compare
Thanks for hacking at this! Let me know when it's ready for review. |
previous code would run client-message/property-change on the event loop thread, generating a deadlock if the observer callback invoked another command.
I use the provided request_id mechanism provided by mpv's ipc interface. Sadly it's a bit more code than I'd like to, but it doesn't seem like it can be implemented in a shorter/simpler fashion.
I'm sure concurrent-ruby's authors are better at coding than me. I hate to add a dependency to an otherwise minimalistic gem, but it kinda felt wrong to NIH this kind of stuff, and anyway it's kind of Ruby's fault for not providing these utilities in the stdlib.
see previous commit for rationale
I should have backported everything from my original gem (while making it much nicer/robust). Next Sunday I will port my "user gem" to use this version of the library in order to dogfood it a little bit. Still unsure about the |
It can also be used in non test code as a synchronization mechanism, so this name makes a little more sense.
cc666d0
to
5f1b898
Compare
Since this is such a common operation that it is worth to make it more convenient by trading some safety. This was the original behavior before introducing the new event loop, so it only makes sense to add this programming style back.
I just realized that this has been sitting idle for a bit. Is there anything else it needs before I do some review @pigoz? |
Yes, sorry. My fault. I was not happy at all with the API for drawing to the OSD but my short attention span prevented me from coming up with something. I might actually remove from this PR so it can move forward. |
No problem at all! Just wanted to see if there was anything I could help with 🙂
Sent from mobile. Please excuse my brevity.
… On Sep 24, 2020, at 2:05 AM, Stefano Pigozzi ***@***.***> wrote:
Yes, sorry. My fault. I was not happy at all with the API for drawing to the OSD but my short attention span prevented me from coming up with something. I might actually remove from this PR so it can move forward.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hello. I've been working on https://github.com/pigoz/lat using this gem as a base to write a Ruby mpv script. I'm in the process of upstreaming the features I've added (key bindings, observers), automated tests, and simplifications to the event loop. I'm still figuring out an API to deal with generic events and one to wait for a certain event. The idea is to allow people to write mpv scripts in ruby instead of Lua / JavaScript.
The exciting part is mpv recently added a way to run any kind of executable script, so you can do stuff like
mpv --script=/path/to/ruby-script
(See: mpv-player/mpv@e2ab6b7)It's not ready to merge yet. But I wanted to start collecting some feedback. If the breaking changes are too many, please say so :)