the latest AutobahnPython comes with a new Flask-like API for writing WAMP applications:
The API is actually just a thin wrapper over the underlying wamp.ApplicationSession, but looks and feels very Flask-esque, which can lower the bar for new users.
The API is (obviously) useful for pure WAMP apps, but how would you actually mix above with Flask if you want to do both WAMP and Web stuff?
The core issue is that Flask (as Django and others) are written on top of a fundamentally blocking API: WSGI.
There are a couple of approaches to work around this like running Flask on a background worker thread pool or using a HTTP-WAMP bridge.
Here is another approach: use Twisted Klein, which essentially is Flask ported to Twisted Web.
This allows you to really use asynchronous code within Web routes. E.g. you can call a WAMP remote procedure upon receiving a HTTP form:
In a way, this is the cleanest approach of all. First-class asynchronous code for both Web and WAMP. However, you will need to write your Web code on top of Klein.
Note: The example runs WAMP and Web on different ports. This could be modified to run on one port also.