Latest commit a6df972 Jul 17, 2016 @oberstet oberstet work

WAMP Programming Examples

There are several very-similar examples that each follow a similar form and demonstrate several different ways of using WAMP under Autobahn. Each of these examples usually includes:

  • the logical "backend", in Python (registers procedures, publishes events)
  • the logical "frontend", in Python (calls endpoints, receives events)
  • frontend.js: similar version in JavaScript
  • backend.js: similar version in JavaScript
  • *.html: boilerplate to hold the .js

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.

The Examples


The following examples show two alternative ways of connecting a WAMP client to a WAMP router. This code is also a good starting point for own apps.

Overview Examples

  • LoopingCall: shows an alternative way of publishing periodically

RPC Examples

  • Arguments: different types of argument-passing
  • Complex: complex return types
  • Decorators: register RPC methods using decorators
  • Errors: map custom error classes to WAMP URIs
  • Options: show some RegistrationOptions and CallOptions use
  • Progress: progressive results for long-running oprations
  • Slow Square: an RPC call that takes some time
  • Time Service: XXX delete?

PubSub Examples

  • Basic: publish to a topic once per second
  • Complex: demonstrates different payload arguments
  • Decorators: doing subscriptions with decorators
  • Options: use of PublishOptions and SubscribeOptions
  • Unsubscribe: listen to events for a limited time

App Examples

We still need to explain these. For starters, here's the list:

How to run

See Running the Examples