> ## Documentation Index
> Fetch the complete documentation index at: https://taskdaemon.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> High-performance polyglot task processing system built in Rust

# Introduction

TaskDaemon is a high-performance, polyglot task processing system built in Rust. Execute task handlers written in **any language** via containerized workers.

## Why TaskDaemon?

<CardGroup cols={2}>
  <Card title="Language Freedom" icon="code">
    Write handlers in Python, Node.js, Go, Rust, C++, Java, C#, or any language
  </Card>

  <Card title="Container Isolation" icon="box">
    Each handler runs in its own container with resource limits
  </Card>

  <Card title="High Performance" icon="bolt">
    Rust core with pre-warmed container pools for sub-10ms latency
  </Card>

  <Card title="Production Ready" icon="shield-check">
    Persistent queue, automatic retries, Prometheus metrics
  </Card>
</CardGroup>

## Key Features

* **Task Selection Strategies** - FIFO, LIFO, or Priority-based task ordering
* **Handler Selection Strategies** - Round-robin, first-available, or random container selection
* **HybridQueue** - In-memory queue with SQLite persistence for speed + durability
* **Priority Tasks** - Queue tasks with priority 0-100 for urgent processing
* **Prometheus Metrics** - Built-in observability with container pool metrics

## How It Works

<Frame>
  <img src="https://mintcdn.com/taskdaemon/nKQ9BRaOuqFu9iC_/images/daemon-architecture.png?fit=max&auto=format&n=nKQ9BRaOuqFu9iC_&q=85&s=ac88ee9ea23dbab7b77225302e9cf900" alt="TaskDaemon Architecture" width="2534" height="1362" data-path="images/daemon-architecture.png" />
</Frame>

1. Client submits a task via HTTP or gRPC
2. TaskDaemon queues the task (with optional priority)
3. Worker picks up task based on selection strategy
4. Handler container processes task and returns result
5. Result stored and available via API

## Quick Example

<Steps>
  <Step title="Define a handler (Python)">
    ```python theme={null}
    from taskdaemon import run, Task, Success

    def handler(task: Task) -> Success:
        name = task.task_data.get("name", "World")
        return Success({"message": f"Hello, {name}!"})

    run(handler)
    ```
  </Step>

  <Step title="Configure TaskDaemon">
    ```toml handlers.toml theme={null}
    [handlers.greet]
    image = "my-greeter:latest"
    instances = 4
    handler_selection = "round-robin"
    ```
  </Step>

  <Step title="Queue a task">
    ```bash theme={null}
    curl -X POST http://localhost:8080/queue \
      -H "Content-Type: application/json" \
      -d '{"type": "greet", "data": {"name": "TaskDaemon"}, "priority": 50}'
    ```
  </Step>
</Steps>

## Handler SDKs

Official SDKs are available for:

| Language | Package                                   |
| -------- | ----------------------------------------- |
| Python   | `pip install taskdaemon`                  |
| Node.js  | `npm install @taskdaemon/handler`         |
| Go       | `go get github.com/taskdaemon/handler-go` |
| Rust     | `cargo add taskdaemon-handler`            |
| C++      | Header-only: `taskdaemon.hpp`             |
| Java     | Maven/Gradle: `com.taskdaemon:handler`    |
| C#       | `dotnet add package TaskDaemon.Handler`   |

Or use the [raw protocol](/handlers/raw-protocol) to write handlers in any language.

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/getting-started/quick-start">
    Get running in 5 minutes
  </Card>

  <Card title="Handler SDKs" icon="puzzle-piece" href="/handlers/overview">
    Write handlers in your language
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration/handlers-toml">
    Configure handlers and strategies
  </Card>

  <Card title="Sample Project" icon="github" href="https://github.com/jona62/TaskDaemon-Sample">
    Complete working example
  </Card>
</CardGroup>
