Browse Source

register_namespace() now returns Namespace instance.

pull/43/merge^2
Robert Schindler 9 years ago
parent
commit
460aed1bdb
  1. 3
      socketio/server.py

3
socketio/server.py

@ -158,11 +158,14 @@ class Server(object):
:param namespace_class: The sub class of ``Namespace`` to register
handlers of. Don't pass an instance instead.
This function returns the instance of ``namespace_class`` created.
See documentation of ``Namespace`` class for an example.
"""
namespace = namespace_class(name, self)
for event, handler in six.iteritems(namespace._get_handlers()):
self.on(event, handler=handler, namespace=name)
return namespace
def emit(self, event, data=None, room=None, skip_sid=None, namespace=None,
callback=None):

Loading…
Cancel
Save