Updated README
This commit is contained in:
parent
672b2fc679
commit
596cd50111
1 changed files with 7 additions and 1 deletions
|
|
@ -42,14 +42,15 @@ Installation
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
---
|
|
||||||
Activate isolated environment.
|
Activate isolated environment.
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
VIRTUAL_ENV=$HOME/.virtualenv
|
VIRTUAL_ENV=$HOME/.virtualenv
|
||||||
source $VIRTUAL_ENV/bin/activate
|
source $VIRTUAL_ENV/bin/activate
|
||||||
|
|
||||||
Emit.
|
Emit.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from socketIOClient import SocketIO
|
from socketIOClient import SocketIO
|
||||||
|
|
@ -58,6 +59,7 @@ Emit.
|
||||||
socketIO.emit('aaa', {'bbb': 'ccc'})
|
socketIO.emit('aaa', {'bbb': 'ccc'})
|
||||||
|
|
||||||
Emit with callback.
|
Emit with callback.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from socketIOClient import SocketIO
|
from socketIOClient import SocketIO
|
||||||
|
|
@ -70,6 +72,7 @@ Emit with callback.
|
||||||
socketIO.wait()
|
socketIO.wait()
|
||||||
|
|
||||||
Define events.
|
Define events.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from socketIOClient import SocketIO
|
from socketIOClient import SocketIO
|
||||||
|
|
@ -81,6 +84,7 @@ Define events.
|
||||||
socketIO.on('ddd', on_ddd)
|
socketIO.on('ddd', on_ddd)
|
||||||
|
|
||||||
Define events in a namespace.
|
Define events in a namespace.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from socketIOClient import SocketIO, BaseNamespace
|
from socketIOClient import SocketIO, BaseNamespace
|
||||||
|
|
@ -93,6 +97,7 @@ Define events in a namespace.
|
||||||
socketIO = SocketIO('localhost', 8000, Namespace)
|
socketIO = SocketIO('localhost', 8000, Namespace)
|
||||||
|
|
||||||
Define standard events.
|
Define standard events.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from socketIOClient import SocketIO, BaseNamespace
|
from socketIOClient import SocketIO, BaseNamespace
|
||||||
|
|
@ -114,6 +119,7 @@ Define standard events.
|
||||||
socketIO = SocketIO('localhost', 8000, Namespace)
|
socketIO = SocketIO('localhost', 8000, Namespace)
|
||||||
|
|
||||||
Define different behavior for different channels on a single socket.
|
Define different behavior for different channels on a single socket.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
mainSocket = SocketIO('localhost', 8000, MainNamespace())
|
mainSocket = SocketIO('localhost', 8000, MainNamespace())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue