# Overview

## Storage

Storage is a place where Doddles keeps all the information related to the jobs and queues.  The storage provider is agnostic in Doddle - it doesn't care where the data is being stored just as long as there is an implementation for it (see implementing a storage provider for doddle)

## Client

All external interactions with Doddle go through the client - it provides a facade to the underlying system.

```java
client.enqueue(wizard -> {
    wizard.queue("high")
          .task("sayHello");
    return wizard;
});
```

Please look at the documentation for the client here.

## Tasks

A task is the work (method) that will be executed by a job. Defining a task is as simple as annotating a method with the `@Task` method.

```java
@Task
public void process(JobExecutionContext context) {
    context.logger().info("Processing job: {}", content.job().id());
}
```

Please look at the introduction to tasks documentation for all the functionalities.

## Scheduler

The scheduler periodically checks for enqueued jobs that are ready to be processed. If a job is ready to be processed then it is marked as *available* ready to be picked up by the next worker thread.&#x20;

It also checks if a CRON (recurring job) needs to be executed and enqueues it ready to be picked up.

The scheduler also has some other responsibilities such as checking for stuck jobs and delete old jobs within a given timeframe.

## Poller

The poller is a pool of worker threads that poll for jobs that are marked as available and processes them. In case of failure, the poller will mark the job as a failure and reschedule for execution at a later date (based on the given retry strategy). In case of success, the job will be marked as completed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jamhall.gitbook.io/doddle/getting-started/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
