Endpoints and Web Servers
Realtime and Streaming
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.
realtime
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
This app can be deployed in traditional Beam fashion:
Streaming Responses from the 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
Was this page helpful?