Rafay workflow handler Python function SDK
Project description
Workflow Handler Python Function SDK
This SDK provides a framework for building Python functions that can be deployed as part of Rafay workflows.
Features
- FastAPI-based web framework for high performance
- Built-in logging and activity tracking
- Error handling with retry mechanisms
- Async/await support with thread pool execution for synchronous handlers
- Configurable concurrency for handling multiple requests
Concurrency Model
The SDK uses FastAPI with async request handling. Since user handler functions are typically synchronous, the SDK runs them in a ThreadPoolExecutor to avoid blocking the event loop.
Environment Variables
FUNCTION_NAME: Name of the function (default: "default-function-name")LOG_LEVEL: Logging level (default: "INFO")LOG_BUFFER_CAPACITY: Number of log messages to buffer (default: 10)MAX_WORKERS: Thread pool size for handling concurrent requests (default: 40)LOG_FLUSH_TIMEOUT: Timeout for flushing logs (default: 10)skip_tls_verify: Skip TLS verification (default: "false")
Concurrency Explanation
- FastAPI Event Loop: Handles incoming HTTP requests asynchronously
- ThreadPoolExecutor: Executes synchronous user handler functions in separate threads
- MAX_WORKERS=40: Up to 40 concurrent handler executions (similar to Flask's WSGI_THREADS=40)
This design provides excellent concurrency for I/O-bound operations while maintaining compatibility with synchronous handler functions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rafay_workflow_sdk-0.0.21.tar.gz.
File metadata
- Download URL: rafay_workflow_sdk-0.0.21.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d60e4a575fb5c96e35643044021210646b9570819748c6b7d20d9111ffe6d28
|
|
| MD5 |
4b4b32eb0f8bdc50eba8a1cff08589c2
|
|
| BLAKE2b-256 |
c42cc5870471d42715dc2f911673ca0b42703056c80bcc282989fcfa9b7d55a1
|
File details
Details for the file rafay_workflow_sdk-0.0.21-py3-none-any.whl.
File metadata
- Download URL: rafay_workflow_sdk-0.0.21-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fd42a9ce43d460a85d43f5b591eecb498c40c973d11fbcd0574109826860e17
|
|
| MD5 |
02898eac2fabffcc4af2c22457ac81f4
|
|
| BLAKE2b-256 |
99c12378bc8b93554c0bad4da8698090dd4ebc5c2c324914ffae29ec79592042
|