Python - websocket()

Creates a new Websocket API.

from nitric.resources import websocket
from nitric.application import Nitric
public_websocket = websocket("public")
Nitric.run()

Parameters

  • Name
    name
    Required
    Required
    Type
    string
    Description

    The unique name of this Websocket within the app. Subsequent calls to websocket with the same name will return the same object.


Examples

Create a Websocket

from nitric.resources import websocket
from nitric.application import Nitric
chat_websocket = websocket("chat")
Nitric.run()
Last updated on Nov 4, 2024