File: README.md

package info (click to toggle)
python-autobahn 17.10.1%2Bdfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,452 kB
  • sloc: python: 22,598; javascript: 2,705; makefile: 497; sh: 3
file content (55 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download | duplicates (5)
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.