RSSAmplifier

Blog

Ricardo Leal

Some stuff...

/RSS feed ↗10 posts

Latest posts

Python Code: fastapi-oxyde

GitHub: PythonCode/fastapi-oxyde fastapi-oxyde CRUD example using FastAPI and Oxyde ORM with Books & Authors models. Database: SQLite in-memory ( sqlite:///:memory: ). Requirements Python 3.12+ uv Setup uv sync Run uv run uvicorn main:app --reload Interactive docs: http://127.0.0.1:8000/docs Endpoints Method Path Description GET /authors/ List all authors (with books) POST /authors/ Create an…

DBOS Experiments: Experiment 25: Multiple Queues with Rate Limiters and Partitioning

GitHub: dbos_experiments/exp25 Experiment 25: Multiple Queues with Rate Limiters and Partitioning Overview This example demonstrates how to use DBOS queues with different rate limiters to control the rate of HTTP requests to external APIs. The example simulates managing API requests to multiple cloud providers (AWS, Azure, GCP) for different data types (users, groups, permissions), where each data…

DBOS Experiments: Exp24: In limbo workflows

GitHub: dbos_experiments/exp24 Exp24: In limbo workflows BUG REPORT! Solved in V2.12 Error Terminal 1 Launch the server with: ❯ uv run python main.py INFO: Started server process [ 2332074] INFO: Waiting for application startup. 16:20:49 [ INFO] ( dbos:_dbos.py:379 ) Initializing DBOS ( v2.8.0 ) 16:20:49 [ INFO] ( dbos:_dbos.py:449 ) Executor ID: exp22-executor-1 16:20:49 [ INFO] (…

DBOS Experiments: DBOS Workflow Communication Patterns

GitHub: dbos_experiments/exp23 DBOS Workflow Communication Patterns This experiment demonstrates three powerful communication patterns for DBOS workflows: Workflow Events - Publish key-value pairs that clients can query Workflow Messaging - Send/receive messages to/from workflows Workflow Streaming - Stream real-time data from workflows to clients Overview The server implements three different…

DBOS Experiments: Exp22: DBOS Graceful Shutdown Example

GitHub: dbos_experiments/exp22 Exp22: DBOS Graceful Shutdown Example This example demonstrates how to implement graceful shutdown for DBOS applications with FastAPI, ensuring that workflows complete properly before the application terminates. Overview This application showcases: Graceful shutdown using FastAPI’s lifespan context manager Async workflows with nested sub-workflows and steps…

DBOS Experiments: Experiment 21: DBOS FastAPI Health Checks During Workflow Execution

GitHub: dbos_experiments/exp21 Experiment 21: DBOS FastAPI Health Checks During Workflow Execution Overview This experiment tests whether a DBOS FastAPI application can respond to health checks while running workflows. Result: It can! The application remains responsive to HTTP requests even when workflows are actively executing in the background. Test Setup FastAPI endpoint at / that enqueues 5…

DBOS Experiments: Experiment 20: DBOS Queue Concurrency Performance

GitHub: dbos_experiments/exp20 Experiment 20: DBOS Queue Concurrency Performance Overview This experiment measures DBOS queue performance with different concurrency settings. It enqueues multiple workflows and tracks execution time to understand how queue concurrency parameters affect throughput. Queue Concurrency Parameters queue = Queue ( "my_queue" , concurrency = 10 , worker_concurrency = 5 )…

DBOS Experiments: Experiment 19: DBOS Class Instantiation Timing

GitHub: dbos_experiments/exp19 Experiment 19: DBOS Class Instantiation Timing Purpose This experiment tests DBOS-decorated class instantiation timing to verify behavior against DBOS documentation, specifically: DBOS-decorated classes must be instantiated before DBOS.launch() is called. What This Tests The code intentionally violates the documented guideline by: Calling DBOS.launch() first Then…

DBOS Experiments: Async Rate Limiter

GitHub: dbos_experiments/exp18 Async Rate Limiter A reusable async rate limiter decorator that evenly spaces function calls over time. Features Even Spacing : Distributes calls uniformly (not bursts) Async-First : Built with asyncio Thread-Safe : Uses asyncio.Lock Zero Dependencies : Python stdlib only Type Hints : Fully typed Installation Copy rate_limiter.py to your project. No external…

DBOS Experiments: ELT Pipeline with DBOS Workflows

GitHub: dbos_experiments/exp17 ELT Pipeline with DBOS Workflows A resilient, distributed ELT (Extract, Load, Transform) pipeline built with DBOS workflows, featuring automatic failure recovery, memory-efficient batching, and data deduplication. Overview This project demonstrates a production-ready ELT pipeline that processes users from multiple external APIs across different organizations and…