# CallbackMode

Artifact: [androidx.webgpu:webgpu](https://developer.android.com/jetpack/androidx/releases/webgpu) [View Source](https://cs.android.com/search?q=file:androidx/webgpu/CallbackMode.kt+class:androidx.webgpu.CallbackMode) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

*** ** * ** ***


```
class CallbackMode
```

<br />

*** ** * ** ***

Controls how and when asynchronous operation callbacks are invoked.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CallbackMode#AllowProcessEvents() = 2` Callbacks may fire within @see GPUInstance.waitAny or @see `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstance#processEvents()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CallbackMode#AllowSpontaneous() = 3` Callbacks may fire spontaneously on any thread when the operation completes. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CallbackMode#WaitAnyOnly() = 1` Callbacks fire only within a call to @see GPUInstance.waitAny. |

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CallbackMode#toString(kotlin.Int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

## Constants

### AllowProcessEvents

```
const val AllowProcessEvents = 2: Int
```

Callbacks may fire within @see GPUInstance.waitAny or @see `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstance#processEvents()`.

### AllowSpontaneous

```
const val AllowSpontaneous = 3: Int
```

Callbacks may fire spontaneously on any thread when the operation completes.

### WaitAnyOnly

```
const val WaitAnyOnly = 1: Int
```

Callbacks fire only within a call to @see GPUInstance.waitAny.

## Public companion functions

### toString

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
fun toString(value: Int): String
```