From eb8b6a05d75a5abb55205f9859ce6f4223735946 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 23 Nov 2016 10:20:49 +0100 Subject: Clarify event thread handling in the README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index b02111f..1468ce4 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,14 @@ player = mpv.MPV(ytdl=True) player.play('https://youtu.be/DOmdB7D-pUU') ``` +Threading +--------- +The ```mpv``` module starts one thread for event handling, since MPV sends events that must be processed quickly. The event queue has a fixed maxmimum size and some operations can cause a large number of events to be sent. + +If you want to handle threading yourself, you can pass ```start_event_thread=False``` to the ```MPV``` constructor and manually call the ```MPV``` object's ```_loop``` function. There is also an out-of-date branch on the repo that you can cherry-pick that brings in asyncio. + +All API functions are thread-safe. If one is not, please file an issue on github. + Advanced Usage ============== ```python -- cgit