> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/documentation/en/framework/core/common/notification.md).

# Notifications

Notification change token tool.

`Notification` is used to create or obtain change tokens, often in conjunction with cache dependencies, configuration refresh, and status observation.

| member                              | Description                                                                                       |
| ----------------------------------- | ------------------------------------------------------------------------------------------------- |
| `Notified`                          | A token that is always in a changed state.                                                        |
| `GetToken(CancellationToken)`       | Wrap a cancelable token as a change token.                                                        |
| `GetToken(CancellationTokenSource)` | Creates a change token from the cancellation source; returns `Notified` when `null` is passed in. |

Source: [framework/Zongsoft.Core/src/Data/DataAccessBase.cs](https://github.com/Zongsoft/framework/blob/main/Zongsoft.Core/src/Data/DataAccessBase.cs#L120) (excerpt; see source for context).

{% code title="DataAccessBase.cs" %}

```csharp
public IChangeToken Disposed => Notification.GetToken(_cancellation);
```

{% endcode %}

The above is the Disposed attribute of the framework data accessor. Discussions Obtains an accessor from Module.Accessor and uses this property as a dependency when caching the accessor: releasing the accessor will trigger an invalidation, causing it to be re-created the next time it is acquired. See [memory cache](/documentation/en/framework/core/caching/memory-cache.md) for the complete link.

Notification itself does not send business messages, nor does it hold reload logic; it converts a cancellation notification into an observable change signal for the cache and configuration components. The token cannot be reset after it expires, and a new cancellation source should be created when the next round of observation is required.

`Notified` is suitable for expressing dependencies that immediately expire, such as scenarios where cache items need to be forced to expire after they are created.

## Related Resources

* [Notification.cs](https://github.com/Zongsoft/framework/blob/main/Zongsoft.Core/src/Common/Notification.cs)


---

# 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://docs.zongsoft.com/documentation/en/framework/core/common/notification.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.
