INNER CODE UNIT · Python

send_email_task

doganarif/fastapi-radar · example_app.py:285

async def send_email_task(email: str, subject: str):
    """Simulated background task for sending emails."""
    import asyncio

    await asyncio.sleep(2)  # Simulate email sending
    return f"Email sent to {email}"


@track_background_task(radar.get_session)
async def process_report(user_id: int):
    """Simulated background task for processing reports."""
    import asyncio

    await asyncio.sleep(3)  # Simulate report processing
    return f"Report processed for user {user_id}"


@track_background_task(radar.get_session)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…