Skip to content
/ Vase Public
forked from vkryachko/Vase

Async Web framework based on Tulip/asyncio

Notifications You must be signed in to change notification settings

levitar/Vase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vase is a webframework for Tulip/asyncio

https://secure.travis-ci.org/vkryachko/Vase.png

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

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, has send(message), close() methods
    """
    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()

About

Async Web framework based on Tulip/asyncio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%