clarify some more docs, descriptions for examples

This commit is contained in:
meejah 2015-06-16 18:04:48 -06:00
parent 26280f721d
commit 349cff3034
4 changed files with 34 additions and 31 deletions

View File

@ -3,12 +3,12 @@
This folder contains complete working code examples that demonstrate various features of **Autobahn**|Python: This folder contains complete working code examples that demonstrate various features of **Autobahn**|Python:
1. **Twisted**-based Examples 1. **Twisted**-based Examples
* [WebSocket](twisted/websocket) * [WebSocket](twisted/websocket/README.md)
* [WAMP](twisted/wamp) * [WAMP](twisted/wamp/README.md)
2. **asyncio**-based Examples 2. **asyncio**-based Examples
* [WebSocket](asyncio/websocket) * [WebSocket](asyncio/websocket/README.md)
* [WAMP](asyncio/wamp) * [WAMP](asyncio/wamp/README.md)
If you are new to Autobahn and WAMP, you should start with the following if you're going to use Twisted: If you are new to Autobahn and WAMP, you should start with the following if you're going to use Twisted:

View File

@ -2,9 +2,8 @@
This is here to facilitate using the examples when running your own This is here to facilitate using the examples when running your own
local Crossbar instance; see the README for how to configure your local Crossbar instance; see running-the-examples.md for instructions
crossbar.io instance to point the root of its static Web directory at on running a local crossbar.io instance.
the directory this file is in.

View File

@ -4,7 +4,7 @@
To run the following examples, you need a WAMP router. To run the following examples, you need a WAMP router.
By default, **all examples are set up to use a a local Crossbar instance**. You can change the URI used with the environment variable AUTOBAHN_DEMO_ROUTER (by default it is `ws://localhost:8080/ws`). Please see [Running Crossbar Locally] below. By default, **all examples are set up to use a local Crossbar instance**. You can change the URI used with the environment variable AUTOBAHN_DEMO_ROUTER (by default it is `ws://localhost:8080/ws`). Please see [Running Crossbar Locally] below.
## Creating a virtualenv ## Creating a virtualenv
@ -12,7 +12,8 @@ By default, **all examples are set up to use a a local Crossbar instance**. You
If you do not yet have a `virtualenv` to run the examples with, you can do something like: If you do not yet have a `virtualenv` to run the examples with, you can do something like:
```shell ```shell
cd ./autobahn-clone/ git clone https://github.com/tavendo/AutobahnPython.git
cd ./AutobahnPython/
virtualenv venv-autobahn virtualenv venv-autobahn
source venv-autobahn/bin/activate source venv-autobahn/bin/activate
pip install -e ./ pip install -e ./
@ -55,7 +56,7 @@ If you want to use your own local [Crossbar](http://crossbar.io) instance you mu
Once you have crossbar installed, use the provided router configuration in `examples/router/.crossbar/config.json`. Starting your router is then: Once you have crossbar installed, use the provided router configuration in `examples/router/.crossbar/config.json`. Starting your router is then:
```shell ```shell
cd examples/router cd ./examples/router
crossbar start crossbar start
``` ```

View File

@ -10,35 +10,38 @@ There are several very-similar examples that each follow a similar form and demo
Note that any WAMP component can "do" all the roles (so a "backend" component can easily also call endpoints or listen for events) but we needed to separate things somehow. However, you can organize your components however you see fit. Note that any WAMP component can "do" all the roles (so a "backend" component can easily also call endpoints or listen for events) but we needed to separate things somehow. However, you can organize your components however you see fit.
For examples using RPC, you need to run the backend first, so that procedures are registered and available to call.
## Simple Examples ## The Examples
1. RPC ### RPC Examples
* [Arguments](rpc/arguments)
* [Complex](rpc/complex)
* [Decorators](rpc/decorators)
* [Errors](rpc/errors)
* [Options](rpc/options)
* [Progress](rpc/progress)
* [Slow Square](rpc/slowsquare)
* [Time Service](rpc/timeservice)
2. PubSub * [Arguments](rpc/arguments): different types of argument-passing
* [Basic](pubsub/basic) * [Complex](rpc/complex): complex return types
* [Complex](pubsub/complex) * [Decorators](rpc/decorators): register RPC methods using decorators
* [Decorators](pubsub/decorators) * [Errors](rpc/errors): map custom error classes to WAMP URIs
* [Options](pubsub/options) * [Options](rpc/options): show some RegistrationOptions and CallOptions use
* [Unsubscribe](pubsub/unsubscribe) * [Progress](rpc/progress): progressive results for long-running oprations
* [Slow Square](rpc/slowsquare): an RPC call that takes some time
* [Time Service](rpc/timeservice): XXX delete?
There also some more "real" examples, implemented as pluggable "WAMPlets". These also serve as skeletons to base your own WAMPlets from, should you wish to package components as illustrated. ### PubSub Examples
3. Vote Game [votegame](wamplet/votegame) * [Basic](pubsub/basic): publish to a topic once per second
* [Complex](pubsub/complex): demonstrates different payload arguments
* [Decorators](pubsub/decorators): doing subscriptions with decorators
* [Options](pubsub/options): use of PublishOptions and SubscribeOptions
* [Unsubscribe](pubsub/unsubscribe): listen to events for a limited time
A collaborative voting "game" to decide the most amazing fruit. There also some larger examples, implemented as pluggable "WAMPlets". These can also serve as skeletons to base your own WAMPlets from, should you wish to package components like this.
4. IRC Bot [wampirc](wamplet/wampirc) ### Vote Game
Basically shows some simple bridging between IRC and WAMP, exporting private messages to the bot as WAMP publish()es. The [votegame](wamplet/votegame) example is a collaborative voting "game" to decide the most amazing fruit. Updates votes amongst all clients in realtime.
### IRC Bot
The [wampirc](wamplet/wampirc) example shows some simple bridging between IRC and WAMP, exporting private messages to the bot as WAMP publish()-es.
## How to run ## How to run