Skip to content

🫒 A nice small cute ASGI inspired by uvicorn.

License

Notifications You must be signed in to change notification settings

ArtyTheDev/hatsu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hatsu 🫒

A nice small cute ASGI inspired by uvicorn impl using wsproto and h11

Quickstart

Installing using pip

pip install git+https://github.com/ArtyTheDev/hatsu.git

Note: This is just an impl I don't think it's ready I wrote this in 3 days and did take a lot from the uvicorn project but did some stuff in my way.

Example

import hatsu

async def app(scope, receive, send):
    message_type = scope['type']

    if message_type == "http":
        await send({
            'type': 'http.response.start',
            'status': 200,
            'headers': [
                (b'content-type', b'text/plain'),
            ],
        })
        await send({
            'type': 'http.response.body',
            'body': b'Hello, world!',
        })

hatsu.run(app, host="localhost", port=8080, workers=1)

this is a simple demo for the application but you can use it using any framework you like such as fastapi, starlette, quart, tinyws

Speedups

you can also speed it up using uvloop

import hatsu

hatsu.loops.set_event_loop_policy("uvloop")

About

🫒 A nice small cute ASGI inspired by uvicorn.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages