Avoid blocking when broadcasting events
This commit is contained in:
parent
5c325b03a1
commit
5c66f19d1a
@ -8,6 +8,10 @@ This change log is used to track all major changes to Mopidy.
|
|||||||
v0.6.0 (in development)
|
v0.6.0 (in development)
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
**Important changes**
|
||||||
|
|
||||||
|
- Pykka 0.12.3 or greater is required.
|
||||||
|
|
||||||
**Changes**
|
**Changes**
|
||||||
|
|
||||||
- Replace :attr:`mopidy.backends.base.Backend.uri_handlers` with
|
- Replace :attr:`mopidy.backends.base.Backend.uri_handlers` with
|
||||||
|
|||||||
@ -25,7 +25,7 @@ Otherwise, make sure you got the required dependencies installed.
|
|||||||
|
|
||||||
- Python >= 2.6, < 3
|
- Python >= 2.6, < 3
|
||||||
|
|
||||||
- `Pykka <http://jodal.github.com/pykka/>`_ >= 0.12
|
- `Pykka <http://jodal.github.com/pykka/>`_ >= 0.12.3
|
||||||
|
|
||||||
- GStreamer >= 0.10, with Python bindings. See :doc:`gstreamer`.
|
- GStreamer >= 0.10, with Python bindings. See :doc:`gstreamer`.
|
||||||
|
|
||||||
|
|||||||
@ -461,18 +461,30 @@ class PlaybackController(object):
|
|||||||
self.current_cp_track = None
|
self.current_cp_track = None
|
||||||
|
|
||||||
def _trigger_started_playing_event(self):
|
def _trigger_started_playing_event(self):
|
||||||
|
logger.debug(u'Triggering started playing event')
|
||||||
if self.current_track is None:
|
if self.current_track is None:
|
||||||
return
|
return
|
||||||
for listener_ref in ActorRegistry.get_by_class(BackendListener):
|
ActorRegistry.broadcast({
|
||||||
listener_ref.proxy().started_playing(track=self.current_track)
|
'command': 'pykka_call',
|
||||||
|
'attr_path': ('started_playing',),
|
||||||
|
'args': [],
|
||||||
|
'kwargs': {'track': self.current_track},
|
||||||
|
}, target_class=BackendListener)
|
||||||
|
|
||||||
def _trigger_stopped_playing_event(self):
|
def _trigger_stopped_playing_event(self):
|
||||||
# TODO Test that this is called on next/prev/end-of-track
|
# TODO Test that this is called on next/prev/end-of-track
|
||||||
|
logger.debug(u'Triggering stopped playing event')
|
||||||
if self.current_track is None:
|
if self.current_track is None:
|
||||||
return
|
return
|
||||||
for listener_ref in ActorRegistry.get_by_class(BackendListener):
|
ActorRegistry.broadcast({
|
||||||
listener_ref.proxy().stopped_playing(
|
'command': 'pykka_call',
|
||||||
track=self.current_track, time_position=self.time_position)
|
'attr_path': ('stopped_playing',),
|
||||||
|
'args': [],
|
||||||
|
'kwargs': {
|
||||||
|
'track': self.current_track,
|
||||||
|
'time_position': self.time_position,
|
||||||
|
},
|
||||||
|
}, target_class=BackendListener)
|
||||||
|
|
||||||
|
|
||||||
class BasePlaybackProvider(object):
|
class BasePlaybackProvider(object):
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Pykka >= 0.12
|
Pykka >= 0.12.3
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user