Skip to main content

Async Web framework based on Tulip/asyncio

Project description

Vase is a webframework for Tulip/asyncio
~~~~~~~~~~~~~~~~~~~~~~

Inspired by Flask
It currently has a basic WSGI interface and WebSocket support.
A demo websocket app is available here http://vase-chat.herokuapp.com/

Sample echo app
~~~~~~~~~~~~~~~~~

.. code-block:: python

from vase import Vase

app = Vase(__name__)


@app.route(path="/")
def hello(request):
return "Hello Vase!"


@app.endpoint(path="/ws/echo")
class EchoEndpoint:
"""
WebSocket endpoint
Has the following attributes:
`bag` - a dictionary that is shared between all instances of this endpoint
`transport` - used to send messages into the websocket
"""
def on_connect(self):
self.transport.send("You are successfully connected")

def on_message(self, message):
self.transport.send(message)

def on_close(self, exc=None):
print("Connection closed")

if __name__ == '__main__':
app.run()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for Vase, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size Vase-0.1.4.tar.gz (8.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page