1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Key-Value Store Service
=======================
This example implements a AutobahnPython based WAMP server with RPC
endpoints providing a persistent key-value store.
The example also demonstrates how to run the WAMP server and a
Twisted Web based web server under one port/service.
A browser based UI is included which uses AutobahnJS to access
the decimal calculator service.
A AutobahnPython based client is also included.
Further, since it's a standard WAMP service, any WAMP client can use
the service. You could access it i.e. from a native
Android app via AutobahnAndroid.
Running
-------
Run the server by doing
python server.py
and open
http://localhost:8080/
in your browser.
This will show up all WAMP messages exchanged between clients and server.
Perspective
-----------
**Persistence**
The service uses the standard Python **shelve** module for persistence.
You can easily adapt that to store data instead in something like
*sqlite*, *PostgreSQL*, *memcached*, *Riak*, .. whatever.
**Change Notification**
You can also easily extend the example to provide PubSub events for automatic change notification.
Upon creating, updating or deleting data for a key, just *dispatch* a PubSub event server-side.
Clients can subscribe to *keys*, and will get notified when data changes.
|