> For the complete documentation index, see [llms.txt](https://definedoddy.gitbook.io/fluid-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://definedoddy.gitbook.io/fluid-api/tasks/repeating-task.md).

# Repeating task

This task is used for repeating actions being sent to the server.

## Creating the task

To create a new delayed task, simply instantiate the **RepeatingTask** class and override the **run()** method:

```java
new RepeatingTask(INITIAL DELAY, REPEATING DELAY) {
    @Override
    public void run() {
        //RUN SOMETHING
    }
};
```

You can also cancel a task before it is executed:

```java
task.cancel();
```

Additionally, you can get the task id by doing the following:

```java
int id = task.getId();
```
