> For the complete documentation index, see [llms.txt](https://coldbox.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox.ortusbooks.com/the-basics/interceptors/interceptor-asynchronicity/asynchronous-annotations.md).

# Asynchronous Annotations

Mark interceptor methods with the async and asyncPriority annotations to run those interception points in a separate thread.

We have also extended the interceptor registration process so you can annotate interception points to denote threading. You will do so with the following two annotations:

| Argument        | Type                       | Required | Default Value | Description                                                                                                                      |
| --------------- | -------------------------- | -------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `async`         | none                       | false    | false         | If the annotation exists, then ColdBox will execute the interception point in a separate thread only if not in a thread already. |
| `asyncPriority` | string : *low,normal,high* | false    | *normal*      | The thread priority that will be sent to each cfthread call that is made by the system.                                          |

This allows you the flexibility to determine in code which points are threaded, which is a great way to use for emails, logging, etc.

```javascript
function preProcess( event, data ) async asyncPriority="low"{
    // Log current request information
    log.info("Executing request: #event.getCurrentEvent()#", getHTTPRequestData() );    
}
```

So if you have 3 interceptors in a chain and only 1 of them is threaded, then the 2 will execute in order while the third one in the background. Overall, your processing power and choices have now grown.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox.ortusbooks.com/the-basics/interceptors/interceptor-asynchronicity/asynchronous-annotations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
