This folder contains a minimal skeleton of a WAMPlet application component.
A WAMPlet can be thought of a reusable application component that can be deployed dynamically as needed.
Get started by copying this folder and it's contents and begin by modifying a working base line.
This example is using asyncio. You can find the Twisted variant here
WAMPlet Development
All the interesting bits with our application component are in here.
For development, start a locally running WAMP router, e.g. Crossbar.io:
cd $HOME
crossbar init
crossbar start
and in a second terminal run the file containing the application component:
python wamplet1/component1.py
WAMPlet Installation and Distribution
For installation as a local WAMPlet in your Python package directory
python setup.py install
Installation of the WAMPlet allows Crossbar.io to find your WAMPlet even if no explicit Python paths are configured.
Above will also leave you an .egg file with your WAMPlet packaged up as a redistributable egg file that can be installed on other hosts. You can even publish your WAMPlet on the Python Package Index.
To make automatic WAMPlet discovery work, the Setup file contains an item
entry_points = {
'autobahn.asyncio.wamplet': [
'component1 = wamplet1.component1:make'
],
},
where entry_points
must have an entry autobahn.asyncio.wamplet
that lists application components the package exposes.
Here, the factory function make()
in the module component1
in the package wamplet1
is to be exposed as the WAMPlet component1
.