Use another event loop for the synchronous websocket communication method
This commit is contained in:
parent
73d7e9a3ef
commit
b555777cc8
1 changed files with 3 additions and 1 deletions
|
@ -109,8 +109,10 @@ class MusicMopidyBackend(Backend):
|
|||
response = response.decode()
|
||||
resp_queue.put(json.loads(response))
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
loop.run_until_complete(get_response())
|
||||
loop.stop()
|
||||
return resp_queue.get().get('result')
|
||||
|
||||
def _get_tracklist_status(self):
|
||||
|
|
Loading…
Reference in a new issue