For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

cancel

abstract fun cancel()(source)

Initiates cancel request. All operations that have been associated with this token will be cancelled.

It is assumed that the implementation will do 'best-effort' attempt to perform cancellation. This method returns immediately and if the cancellation is successful the cancelled operation will notify its onFailure with a BuildCancelledException describing how it was cancelled.

Since

2.1