Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="https://github.com/invisibleroads/socketIO-client" rel="noreferrer">socketIO-client</a> library supports event callbacks and channels thanks to the work of contributors and is available on <a href="http://pypi.python.org/pypi/socketIO-client" rel="noreferrer">PyPI</a> under the MIT license.</p> <p><em>Emit with callback.</em></p> <pre><code>from socketIO_client import SocketIO def on_bbb_response(*args): print 'on_bbb_response', args with SocketIO('localhost', 8000) as socketIO: socketIO.emit('bbb', {'xxx': 'yyy'}, on_bbb_response) socketIO.wait_for_callbacks(seconds=1) </code></pre> <p><em>Define events.</em></p> <pre><code>from socketIO_client import SocketIO def on_aaa_response(*args): print 'on_aaa_response', args socketIO = SocketIO('localhost', 8000) socketIO.on('aaa_response', on_aaa_response) socketIO.emit('aaa') socketIO.wait(seconds=1) </code></pre> <p><em>Define events in a namespace.</em></p> <pre><code>from socketIO_client import SocketIO, BaseNamespace class Namespace(BaseNamespace): def on_aaa_response(self, *args): print 'on_aaa_response', args self.emit('bbb') socketIO = SocketIO('localhost', 8000) socketIO.define(Namespace) socketIO.emit('aaa') socketIO.wait(seconds=1) </code></pre> <p><em>Define different namespaces on a single socket.</em></p> <pre><code>from socketIO_client import SocketIO, BaseNamespace class ChatNamespace(BaseNamespace): def on_aaa_response(self, *args): print 'on_aaa_response', args class NewsNamespace(BaseNamespace): def on_aaa_response(self, *args): print 'on_aaa_response', args socketIO = SocketIO('localhost', 8000) chatNamespace = socketIO.define(ChatNamespace, '/chat') newsNamespace = socketIO.define(NewsNamespace, '/news') chatNamespace.emit('aaa') newsNamespace.emit('aaa') socketIO.wait(seconds=1) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload