Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update custom namespace doc example #364

Merged
merged 1 commit into from
Nov 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Welcome to Flask-SocketIO's documentation!

**Flask-SocketIO** gives Flask applications access to low latency
bi-directional communications between the clients and the server. The
client-side application can use any of the `SocketIO <http://socket.io>`_
client-side application can use any of the `SocketIO <http://socket.io>`_
official clients libraries in Javascript, C++, Java and Swift, or any
compatible client to establish a permanent connection to the server.

Expand Down Expand Up @@ -52,7 +52,7 @@ development server is used.
If using multiple processes, a message queue service is used by the processes
to coordinate operations such as broadcasting. The supported queues are
`Redis <http://redis.io/>`_, `RabbitMQ <https://www.rabbitmq.com/>`_, and any
other message queues supported by the
other message queues supported by the
`Kombu <http://kombu.readthedocs.org/en/latest/>`_ package.

On the client-side, the official Socket.IO Javascript client library can be
Expand Down Expand Up @@ -345,13 +345,13 @@ create class-based namespaces::
from flask_socketio import Namespace, emit

class MyCustomNamespace(Namespace):
def on_connect():
def on_connect(self):
pass

def on_disconnect():
def on_disconnect(self):
pass

def on_my_event(data):
def on_my_event(self, data):
emit('my_response', data)

socketio.on_namespace(MyCustomNamespace('/test'))
Expand All @@ -364,7 +364,7 @@ the namespace class, then the event is ignored. All event names used in
class-based namespaces must used characters that are legal in method names.

As a convenience to methods defined in a class-based namespace, the namespace
instance includes versions of several of the methods in the
instance includes versions of several of the methods in the
:class:`flask_socketio.SocketIO` class that default to the proper namespace
when the ``namespace`` argument is not given.

Expand Down Expand Up @@ -642,7 +642,7 @@ be installed:

- For Redis, the package ``redis`` must be installed (``pip install redis``).
- For RabbitMQ, the package ``kombu`` must be installed (``pip install kombu``).
- For other message queues supported by Kombu, see the `Kombu documentation
- For other message queues supported by Kombu, see the `Kombu documentation
<http://docs.celeryproject.org/projects/kombu/en/latest/introduction.html#transport-comparison>`_
to find out what dependencies are needed.
- If eventlet or gevent are used, then monkey patching the Python standard
Expand Down