Deploying a Realtime App
This is a simple example of a realtime streaming app. When deployed, this app will be exposed as a public websocket endpoint. Therealtime
handler accepts a single parameter, called event
, with the event payload.
The
realtime
decorator is an abstraction above asgi
.This means that additional parameters in asgi
, such as concurrent_requests
can be used too.app.py
Streaming Responses from the Client
Realtime Endpoints can be connected to from any websocket client.The code below uses the Beam Javascript SDK to send requests to the realtime app.Make sure to add an
.env
file to your project with your BEAM_DEPLOYMENT_ID
and BEAM_TOKEN
:client.js