Giter VIP home page Giter VIP logo

Comments (7)

jaseg avatar jaseg commented on September 17, 2024

Fixed in eb8b6a0. As a small bonus, you now can also call the constructor with start_event_thread=False and call the resulting object's ._loop function yourself. That acts much like gtk.main. If for some reason you don't like threading at all, there is an out-of-date branch on this repo that contains python3 asyncio-based handling of events (which I ripped out because it was unportable and really awkward to use at no benefit).

from python-mpv.

ssokolow avatar ssokolow commented on September 17, 2024

Thanks. While I'd consider renaming ._loop since it's no longer being presented as a private method, what you've done so far definitely resolves this.

Once I have time to work this into some of my projects as a replacement for an awkward, organically overgrown "call mpv in a subprocess once per file" system, I'll probably offer up a few improvements to the docs to cover what I learn from poking at it more.

from python-mpv.

rr- avatar rr- commented on September 17, 2024

I can no longer see the asyncio branch

from python-mpv.

jaseg avatar jaseg commented on September 17, 2024

True. I wonder where that went. I must have deleted it during some rebasing action. If you really need it, I can pull it out of an old backup.

from python-mpv.

rr- avatar rr- commented on September 17, 2024

Looks like the event thread plays nice with my script which leverages asyncio, so I won't be needing it - I was mostly curious what it looked like.

Anyway, the README file still refers to that branch, so you might want to correct that.
Thanks

from python-mpv.

jaseg avatar jaseg commented on September 17, 2024

Done.

The basic layout was that libmpv has some function that produces a sort of event fd that gets a single byte written to or something on every event received, and you could pass that into asyncio's event loop to wake up the event handler on every event.

from python-mpv.

jaseg avatar jaseg commented on September 17, 2024

Thank for the report 😸

from python-mpv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.