.. _examples_overview:
Overview of Examples
====================
The examples give an overview of the features of |ab| by providing working code.
Read, run, and modify as you like!
.. note:: Most examples provide HTML clients and/or JavaScript versions of the Python code. JavaScript code for WAMP v2 runs both in the browser and in Node.js.
.. _websocket_examples:
WebSocket
---------
|ab| provides WebSocket both under `Twisted `_ and `asyncio `_.
Basic Examples
++++++++++++++
* WebSocket Echo: `Twisted `__ - `asyncio `__
* Slow Square: `Twisted `__ - `asyncio `__
* Testee: `Twisted `__ - `asyncio `__
Additional Examples (Twisted only)
++++++++++++++++++++++++++++++++++
* `Broadcasting over WebSocket `_
* `WebSocket Compression `_
* `WebSocket over Twisted Endpoints `_
* `Using HTTP Headers with WebSocket `_
* `WebSocket on Multicore `_
* `WebSocket as a Twisted Service `_
* `Running WebSocket under Twisted Web `_
* `Running secure WebSocket under Twisted Web `_
* `WebSocket Echo over secure WebSocket `_
* `WebSocket Echo Variants `_
* `WebSocket Fallbacks `_
* `WebSocket and WSGI/Flask `_
* `Using multiple WebSocket Protocols `_
* `WebSocket Pings/Pongs `_
* `Streaming WebSocket `_
* `Wrapping Twisted Protocol/Factories over WebSocket `_
WAMP v2
-------
Publish & Subscribe (PubSub)
++++++++++++++++++++++++++++
* Basic `Twisted `__ - `asyncio `__ - Demonstrates basic publish and subscribe.
* Complex `Twisted `__ - `asyncio `__ - Demonstrates publish and subscribe with complex events.
* Options `Twisted `__ - `asyncio `__ - Using options with PubSub.
* Unsubscribe `Twisted `__ - `asyncio `__ - Cancel a subscription to a topic.
Remote Procedure Calls (RPC)
++++++++++++++++++++++++++++
* Time Service `Twisted `__ - `asyncio `__ - A trivial time service - demonstrates basic remote procedure feature.
* Slow Square `Twisted `__ - `asyncio `__ - Demonstrates procedures which return promises and return asynchronously.
* Arguments `Twisted `__ - `asyncio `__ - Demonstrates all variants of call arguments.
* Complex Result `Twisted `__ - `asyncio `__ - Demonstrates complex call results (call results with more than one positional or keyword results).
* Errors `Twisted `__ - `asyncio `__ - Demonstrates error raising and catching over remote procedures.
* Progressive Results `Twisted `__ - `asyncio `__ - Demonstrates calling remote procedures that produce progressive results.
* Options `Twisted `__ - `asyncio `__ - Using options with RPC.
WAMP v1
-------
Examples demonstrating specific features:
Publish & Subscribe
+++++++++++++++++++
* `Basic PubSub 1 `_
* `Basic PubSub 2 `_
* `Custom PubSub Handlers `_
* `Profiling PubSub `_
Remote Procedure Calls
++++++++++++++++++++++
* `Basic RPCs 1 `_
* `Basic RPCs 2 `_
* `Symmetric RPCs `_
* `Profiling RPCs `_
Authentication
++++++++++++++
* `Authenticating via WAMP-CRA `_
and small example apps
* `Decimal Calculator `_
* `A Key-Value Store `_
* `A WAMP-DBus Bridge `_
* `A directory watcher `_
* `Serial/Arduino-to-WAMP Bridge `_