Mopidy Audio Server
Go to file
Thomas Adamcik 4ee7dd73bd http: Make WS broadcast more robust against disconnect race
Adds some WebSocketHandler tests that actually connect using a WS client and
plugs a potential race condition.

Any call to write_message could fail, either due to WebSocketClosedError like
in the log below, or simply due to socket errors. To play it safe we catch all
errors and debug log that a broadcast failed.

2015-02-26 21:24:02,266 ERROR    [HttpServer] /home/adamcik/dev/mopidy/mopidy/http/handlers.py:116
  mopidy.http.handlers WebSocket request error: deque index out of range
2015-02-26 21:24:10,098 ERROR    [HttpFrontend-11] build/bdist.linux-x86_64/egg/pykka/actor.py:268
  pykka Unhandled exception in HttpFrontend (urn:uuid:e376bd95-c32e-4e17-ad20-7d0b3c0cf2b2):
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File ".../dev/mopidy/mopidy/http/actor.py", line 77, in on_event
    on_event(name, **data)
  File ".../dev/mopidy/mopidy/http/actor.py", line 84, in on_event
    handlers.WebSocketHandler.broadcast(message)
  File ".../dev/mopidy/mopidy/http/handlers.py", line 78, in broadcast
    client.write_message(msg)
  File ".../dev/mopidy-virtualenv/local/lib/python2.7/site-packages/tornado/websocket.py", line 183, in write_message
    raise WebSocketClosedError()
WebSocketClosedError
2015-03-02 00:05:21 +01:00
docs Merge pull request #1002 from adamcik/fix/694 2015-02-25 23:36:13 +01:00
extra Add mopidyctl script and manpage 2014-12-27 14:47:53 +01:00
mopidy http: Make WS broadcast more robust against disconnect race 2015-03-02 00:05:21 +01:00
tests http: Make WS broadcast more robust against disconnect race 2015-03-02 00:05:21 +01:00
.coveragerc coveralls: Filter out non-Mopidy sources 2013-10-06 20:49:11 +02:00
.gitignore js: Remove references to js/ dir 2014-09-11 22:16:11 +02:00
.mailmap docs: Update authors 2015-02-13 01:51:08 +01:00
.travis.yml travis: Update tox env names 2014-07-29 23:15:05 +02:00
AUTHORS docs: Update authors 2015-02-13 01:51:08 +01:00
dev-requirements.txt Switch from Fabric to Invoke 2014-09-11 00:01:50 +02:00
LICENSE Source code license is now Apache License v2.0. Documentation license is CC BY-SA 3.0 Unported License. 2010-08-13 20:41:40 +02:00
MANIFEST.in Move {data => extra/desktop}/mopidy.desktop 2014-12-27 14:47:53 +01:00
README.rst docs: Docs site has HTTPS now 2015-01-01 12:47:37 +01:00
setup.cfg flake8: Fix new warnings after flake8 upgrade 2015-02-12 23:14:17 +01:00
setup.py py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
tasks.py tasks: Pass path and coverage on to test task 2014-09-12 11:31:05 +02:00
tox.ini tests: Add pep8-naming to tox flake8 env 2014-12-30 00:32:03 +01:00

******
Mopidy
******

Mopidy is an extensible music server written in Python.

Mopidy plays music from local disk, Spotify, SoundCloud, Google Play Music, and
more. You edit the playlist from any phone, tablet, or computer using a range
of MPD and web clients.

**Stream music from the cloud**

Vanilla Mopidy only plays music from your local disk and radio streams.
Through extensions, Mopidy can play music from cloud services like Spotify,
SoundCloud, and Google Play Music. With Mopidy's extension support, backends
for new music sources can be easily added.

**Mopidy is just a server**

Mopidy is a Python application that runs in a terminal or in the background on
Linux computers or Macs that have network connectivity and audio output. Out of
the box, Mopidy is an MPD and HTTP server. Additional frontends for controlling
Mopidy can be installed from extensions.

**Everybody use their favorite client**

You and the people around you can all connect their favorite MPD or web client
to the Mopidy server to search for music and manage the playlist together. With
a browser or MPD client, which is available for all popular operating systems,
you can control the music from any phone, tablet, or computer.

**Mopidy on Raspberry Pi**

The Raspberry Pi is a popular device to run Mopidy on, either using Raspbian or
Arch Linux. It is quite slow, but it is very affordable. In fact, the
Kickstarter funded Gramofon: Modern Cloud Jukebox project used Mopidy on a
Raspberry Pi to prototype the Gramofon device. Mopidy is also a major building
block in the Pi Musicbox integrated audio jukebox system for Raspberry Pi.

**Mopidy is hackable**

Mopidy's extension support and Python, JSON-RPC, and JavaScript APIs makes
Mopidy perfect for building your own hacks. In one project, a Raspberry Pi was
embedded in an old cassette player. The buttons and volume control are wired up
with GPIO on the Raspberry Pi, and is used to control playback through a custom
Mopidy extension. The cassettes have NFC tags used to select playlists from
Spotify.

To get started with Mopidy, check out
`the installation docs <http://docs.mopidy.com/en/latest/installation/>`_.

- `Documentation <https://docs.mopidy.com/>`_
- `Discussion forum <https://discuss.mopidy.com/>`_
- `Source code <https://github.com/mopidy/mopidy>`_
- `Issue tracker <https://github.com/mopidy/mopidy/issues>`_
- `Development branch tarball <https://github.com/mopidy/mopidy/archive/develop.tar.gz#egg=mopidy-dev>`_

- IRC: ``#mopidy`` at `irc.freenode.net <http://freenode.net/>`_
- Announcement list: `mopidy@googlegroups.com <https://groups.google.com/forum/?fromgroups=#!forum/mopidy>`_
- Twitter: `@mopidy <https://twitter.com/mopidy/>`_

.. image:: https://img.shields.io/pypi/v/Mopidy.svg?style=flat
    :target: https://pypi.python.org/pypi/Mopidy/
    :alt: Latest PyPI version

.. image:: https://img.shields.io/pypi/dm/Mopidy.svg?style=flat
    :target: https://pypi.python.org/pypi/Mopidy/
    :alt: Number of PyPI downloads

.. image:: https://img.shields.io/travis/mopidy/mopidy/develop.svg?style=flat
    :target: https://travis-ci.org/mopidy/mopidy
    :alt: Travis CI build status

.. image:: https://img.shields.io/coveralls/mopidy/mopidy/develop.svg?style=flat
   :target: https://coveralls.io/r/mopidy/mopidy?branch=develop
   :alt: Test coverage