github sparckles/Robyn v0.44.0
v0.44.0 - [🚨BREAKING] - Add a new way of using websockets - implement broadcasts and sends

latest releases: v0.66.0, v0.65.1, v0.65.0...
17 months ago

What's Changed

@websocket.on("message")
async def message(ws: WebSocketConnector, msg: str) -> str:
    global websocket_state
    websocket_id = ws.id
    state = websocket_state[websocket_id]
    resp = ""
    if state == 0:
        resp = "Whaaat??"
        await ws.async_broadcast("This is a broadcast message")
        ws.sync_send_to(websocket_id, "This is a message to self")
    elif state == 1:
        resp = "Whooo??"
    elif state == 2:
        resp = "*chika* *chika* Slim Shady."
    websocket_state[websocket_id] = (state + 1) % 3

    return resp

Full Changelog: v0.43.0...v0.44.0

Don't miss a new Robyn release

NewReleases is sending notifications on new releases.