sp.streaming_endpoint
Overview
The @outspeed.streaming_endpoint
decorator is used to define asynchronous functions that handle streaming data in outspeed applications. This decorator allows the function to process continuous streams of data such as audio, video, or any other streamable data types.
Creating Streaming Functions
Streaming functions are defined using the @outspeed.streaming_endpoint
decorator. Below is an example of how to create a streaming function that processes audio and video streams:
Note the type hints in the function’s arguments. These are strictly required. Type hints are picked up by the outspeed package, and are used to generate the streams.
Specifying Additional Data for Streaming Functions
You can customize the environment of your streaming functions using various parameters in the @outspeed.streaming_endpoint
decorator:
Parameter | Type | Description | Default |
---|---|---|---|
name | str | Defines the name of the streaming function | Default is determined by the system |
python_version | str | Specifies the Python version to be used | Default is determined by the system |
python_packages | List[str] | Specifies additional Python packages to be installed | [] |
system_packages | List[str] | Specifies additional system packages to be installed | [] |
metadata | outspeed.Metadata | Provides additional metadata about the function to be displayed on the dashboard | None |
These parameters help tailor the execution environment to the specific needs of your streaming function, ensuring optimal performance and compatibility.