Skip to content

v0.10.0 - Async Functions now supported in Web Sockets

Compare
Choose a tag to compare
@sansyrox sansyrox released this 20 Dec 09:12
· 416 commits to main since this release

The latest version of Robyn supports async functions in WebSockets now!

Usage

@websocket.on("message")
async def connect():
    global i
    i+=1
    if i==0:
        return "Whaaat??"
    elif i==1:
        return "Whooo??"
    elif i==2:
        return "*chika* *chika* Slim Shady."
    elif i==3:
        i= -1
        return ""

@websocket.on("close")
async def close():
    return "Goodbye world, from ws"

@websocket.on("connect")
async def message():
    return "Hello world, from ws"

Important Note:

Async functions execute out of order. i.e. They do not block the actor in order to provide concurrent execution. However, if the order is essential for you while using async functions, try using sync functions for now or wait for a future release :D

What's Changed

New Contributors

Full Changelog: v0.9.0...v0.10.0

Thanks

Thanks to @Kludex @awestlake87 @ShadowJonathan @shivaylamba @messense for their help(Issues/PRs) with this release. 😄